Pour obtenir une clé
d'essai remplissez le formulaire ci-dessous
Demandez des tariffs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
RUB
* En cliquant sur ce bouton, vous acceptez notre politique de confidentialité

Free PVS-Studio license for Microsoft MVP specialists
To get the licence for your open-source project, please fill out this form
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

I am interested to try it on the platforms:
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

Votre message a été envoyé.

Nous vous répondrons à


Si vous n'avez toujours pas reçu de réponse, vérifiez votre dossier
Spam/Junk et cliquez sur le bouton "Not Spam".
De cette façon, vous ne manquerez la réponse de notre équipe.

>
>
Configuration of the Warnings Next Gene…

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

09 Sep 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.webp

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.webp

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

0668_WarningsNextGenerationPlugin/image3.webp

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

0668_WarningsNextGenerationPlugin/image4.webp

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

0668_WarningsNextGenerationPlugin/image5.webp

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

0668_WarningsNextGenerationPlugin/image6.webp

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.webp

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.webp

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.webp

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.webp

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.webp

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/image12.webp

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/image14.webp

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/image15.webp

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

0668_WarningsNextGenerationPlugin/image16.webp

The graph after hiding the "Normal" metric:

0668_WarningsNextGenerationPlugin/image17.webp

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

0668_WarningsNextGenerationPlugin/image18.webp

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/image20.webp

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

0668_WarningsNextGenerationPlugin/image21.webp

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/image22.webp

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/image23.webp

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/image24.webp

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
I want to use PVS-Studio in my project. The manager is against it. How to convince them?

Date: 02 Aoû 2022

Author: Sergey Vasiliev

You decided to integrate PVS-Studio into your project. But suddenly it turns out that the manager is against it, because... because why, actually? Let's try to figure out what to do with potential ob…
How PVS-Studio for Windows got new monitoring mode

Date: 14 Jui 2022

Author: Alexey Govorov

In PVS-Studio 7.18, the compiler monitoring utility for Windows got new mechanism that completely eliminates missed compiler launches. In this article, we will remind you how our analyzer copes with …
SAST in Secure SDLC: 3 reasons to integrate it in a DevSecOps pipeline

Date: 19 Avr 2022

Author: Sergey Vasiliev

Vulnerabilities produce enormous reputational and financial risks. That's why many companies are fascinated by security and desire to build a secure development life cycle (SSDLC). So, today we're go…
What's new in PVS-Studio in 2021?

Date: 31 Déc 2021

Author: Maxim Stefanov, Oleg Lisiy, Sergey Vasiliev

2021 is coming to an end, which means it's time to sum up the year! Today we'll tell you about the new features we added to PVS-Studio in the past year. Buckle up and let's go!
VSCode: how to view reports of static analyzers that support SARIF

Date: 09 Aoû 2021

Author: Nikolay Mironov

People increasingly start optimizing the process of finding code errors using static analyzers. Nowadays, we can choose from a variety of products to view analysis results. This post covers the ways …

Comments (0)

Next comments
Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter