To get a trial key
fill out the form below
Team License (standard version)
Enterprise License (extended version)
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
GBP
RUB
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
Configuration of the Warnings Next Gene…

Configuration of the Warnings Next Generation plugin for integration with PVS-Studio

Sep 09 2019

The PVS-Studio 7.04 release coincided with the release of the Warnings Next Generation 6.0.0 plugin for Jenkins. Right in this release Warnings NG Plugin added support of the PVS-Studio static code analyzer. This plugin visualizes data related to compiler warnings or other analysis tools in Jenkins. This article will cover in detail how to install and configure this plugin to use it with PVS-Studio, and will describe most of its features.

0668_WarningsNextGenerationPlugin/image1.png

Installation of Warning Next Generation Plugin in Jenkins

By default, Jenkins is located at http://localhost:8080. On the front page of Jenkins on the top left, choose the item "Manage Jenkins":

0668_WarningsNextGenerationPlugin/image2.png

Next, select "Manage Plugins" and open the "Available" tab:

0668_WarningsNextGenerationPlugin/image3.png

In the top right corner, enter "Warnings Next Generation" in the filter field:

0668_WarningsNextGenerationPlugin/image4.png

Find the plugin in the list, put a tick on the left and click "Install without restart":

0668_WarningsNextGenerationPlugin/image5.png

The plugin installation page will open. It will show us the results of the plugin installation:

0668_WarningsNextGenerationPlugin/image6.png

Creating a New Task in Jenkins

Now let's create a free configuration task. On the main Jenkins page, choose "New Item". Enter the project name (for example, WTM) and choose "Freestyle project".

0668_WarningsNextGenerationPlugin/image7.png

Click "Ok", then the task configuration page will open. Open the list "Add post-build action" at the bottom of this page in the item "Post-build Actions". In the list, select "Record compiler warnings and static analysis results":

0668_WarningsNextGenerationPlugin/image8.png

In the drop-down list of the field "Tool" choose "PVS-Studio" and then click save. On the task page, click "Build Now" to create a folder in Jenkins' workspace for our task:

0668_WarningsNextGenerationPlugin/image9.png

Getting Project Build Results

Today I stumbled upon the project dotnetcore/WTM in Github trends. I downloaded it from Github, pasted in the WTM build directory in Jenkins and analyzed in Visual Studio using the PVS-Studio analyzer. A detailed description of PVS-Studio usage in Visual Studio is given in the same name article: PVS-Studio for Visual Studio.

After that, I ran the project build in Jenkins a couple of times. As a result, a graph appeared on the right at the top of the WTM task page in Jenkins. A menu item PVS-Studio Warnings appeared on the left:

0668_WarningsNextGenerationPlugin/image10.png

By clicking the graph or this menu item, you'll open the page with visualization of the PVS-Studio analyzer report by the plugin Warnings Next Generation:

0668_WarningsNextGenerationPlugin/image11.png

Results Page

There are two pie charts on the top of the page. To the right of these charts, there is a graph window. A table is at the bottom.

0668_WarningsNextGenerationPlugin/image13.png

The left pie chart shows the ratio of warnings of different levels of danger, on the right - the ratio of new, outstanding and fixed warnings. There are three graphs. You can choose the graphs to display using the arrows on the left and right. First two graphs show the same information as charts and the third one shows the number a change in the number of warnings.

0668_WarningsNextGenerationPlugin/image15.png

You can choose builds or days as graph points.

It is also possible to narrow and expand the time range of the graphs to see the data for a certain period:

0668_WarningsNextGenerationPlugin/image16.png

You can hide the graphs of certain metrics by clicking on the metric designation in the legend of the graph:

0668_WarningsNextGenerationPlugin/image17.png

The graph after hiding the "Normal" metric:

0668_WarningsNextGenerationPlugin/image18.png

The table at the bottom displays the analyzer report data. When you click on the pie sector, the table is filtered:

0668_WarningsNextGenerationPlugin/image19.png

There are several bookmarks in the table to filter the data. In this example, filtering is available by namespace, file, category (warning name). In the table, you can choose the number of warnings to display per page (10, 25, 50, 100):

0668_WarningsNextGenerationPlugin/image21.png

You can filter data by a line entered in the "Search" field. An example of filtering by the word "Base":

0668_WarningsNextGenerationPlugin/image22.png

On the "Issues" tab, when you click on the plus at the top of the table line, a short warning description will be displayed:

0668_WarningsNextGenerationPlugin/image23.png

The short description contains a link to the site with detailed information on this warning.

When you click on the values in the "Package", "Category", "Type", "Severity" columns, the table's data is filtered by the chosen value. Filtering by category:

0668_WarningsNextGenerationPlugin/image24.png

The column "Age" shows the number of builds with a certain warning. When clicking the value in the column "Age", a build page will open when a certain warning has first appeared.

When clicking the value in the column "File", the file's source code will open on the line with the code that caused the warning. If a file is absent in the build directory or was removed after creating the report, opening the file's source code will be unavailable.

0668_WarningsNextGenerationPlugin/image25.png

Conclusion

Warnings Next Generation turned out to be a very convenient tool for data visualization in Jenkins. We hope that support of this plugin by PVS-Studio will help those who already use PVS-Studio, as well as draw attention of other Jenkins users to static analysis. If your choice falls on PVS-Studio as a static code analyzer, we'll be very pleased. You're welcome to download and try our tool.

Popular related articles
The Ultimate Question of Programming, Refactoring, and Everything

Date: Apr 14 2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…
The Evil within the Comparison Functions

Date: May 19 2017

Author: Andrey Karpov

Perhaps, readers remember my article titled "Last line effect". It describes a pattern I've once noticed: in most cases programmers make an error in the last line of similar text blocks. Now I want t…
Static analysis as part of the development process in Unreal Engine

Date: Jun 27 2017

Author: Andrey Karpov

Unreal Engine continues to develop as new code is added and previously written code is changed. What is the inevitable consequence of ongoing development in a project? The emergence of new bugs in th…
The Last Line Effect

Date: May 31 2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
The way static analyzers fight against false positives, and why they do it

Date: Mar 20 2017

Author: Andrey Karpov

In my previous article I wrote that I don't like the approach of evaluating the efficiency of static analyzers with the help of synthetic tests. In that article, I give the example of a code fragment…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: Oct 22 2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
PVS-Studio for Java

Date: Jan 17 2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities

Date: Nov 21 2018

Author: Andrey Karpov

A brief description of technologies used in the PVS-Studio tool, which let us effectively detect a large number of error patterns and potential vulnerabilities. The article describes the implementati…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: Jul 31 2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…
Free PVS-Studio for those who develops open source projects

Date: Dec 22 2018

Author: Andrey Karpov

On the New 2019 year's eve, a PVS-Studio team decided to make a nice gift for all contributors of open-source projects hosted on GitHub, GitLab or Bitbucket. They are given free usage of PVS-Studio s…

Comments (0)

Next comments

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →
Accept