<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Statisch Code Analyse ausführen via Python</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/7d22ff25c7/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/7d22ff25c7/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/7d22ff25c7/</id><updated>2024-03-15T09:28:45.807000Z</updated><subtitle>Recent posts to Statisch Code Analyse ausführen via Python</subtitle><entry><title>Statisch Code Analyse ausführen via Python</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/7d22ff25c7/?limit=25#9e59" rel="alternate"/><published>2024-03-15T09:28:45.807000Z</published><updated>2024-03-15T09:28:45.807000Z</updated><author><name>k4zz</name><uri>https://forge.codesys.com/u/k4zz/</uri></author><id>https://forge.codesys.com4b38f93f7b35d5668bdaf521fecd311f214dfdff</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Derzeit arbeite ich daran, statische Codeanalyse in unsere (CI/CD)-Pipeline zu integrieren. Konkret habe ich die Statisch Code Analyse erfolgreich für &lt;em&gt;.project-Typen ausgeführt, und sie funktioniert einwandfrei. Jedoch habe ich Schwierigkeiten bei der Ausführung derselben für &lt;/em&gt;.library-Typen festgestellt.&lt;br/&gt;
Hier habe ich zwei Methoden ausprobiert:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;system.commands["staticanalysis", "run"].execute()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;#&lt;/span&gt; get Project values
myProject = projects.primary

&lt;span class="gh"&gt;#&lt;/span&gt; Creates an active application
app = myProject.active_application

&lt;span class="gh"&gt;#&lt;/span&gt; build Application and run static code analysis 
app.generate_code()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</summary></entry></feed>