Running PVS-Studio in TeamCity

Automating the analyzer run

In order to automate the analysis process in CI (Continuous Integration), you need to run the analyzer as a console application.

You need to create a Build Step in TeamCity with the following parameters:

  • Runner type: Command Line;
  • Step Name: <name>;
  • Run: Custom script;
  • Custom script: <script>.

In the script, write the analysis command (and the command for converting the report in the needed format).

Examples of commands to run the analyzer, handle the analysis results and integrate the analyzer into build systems are given on the following pages of documentation:

Viewing analysis results

In TeamCity you can attach analyzer reports in the HTML format to builds, having specified them in the artifacts.

Here are some ways to generate an HTML report with navigation along the code:

Windows: C, C++, C#

PlogConverter.exe ... --renderTypes FullHtml ...

Linux/macOS: C, C++

plog-converter ... --renderTypes fullhtml ... 

Windows/Linux/macOS: Java

In the plugins settings for Maven and Gradle in the outputType field set the fullhtml value.

In the menu Edit Configuration Settings > General Settings > Artifact paths specify the directory with the resulting HTML-report.

After successful build, the analyzer report will appear on the new tab in this build information:

Picture 1

When clicking analyzer warnings, additional browser tabs will be opening:

Picture 2

In other CIs, configuration of analyzer runs and working with reports are performed in the same way.

Additional links

Bugs Found

Checked Projects
Collected Errors
13 676