📜 ⬆️ ⬇️

PVS-Studio report is now in Html format

Picture 2

The PVS-Studio analyzer has already had an Html report for a long time, but it was so simple that it was only suitable for reviewing the results of a small volume analysis, for example, via email. In this post I will tell you how this format was reworked and what new features it opens for the analyzer users.

Introduction


An additional popular code quality control script is to view the results of a project analysis on a server remotely via a web browser. Therefore, in PVS-Studio, a second version of Html reports appeared, called FullHtml. Unlike the first option (SimpleHtml), the new Html report makes other work scenarios available. Further, I will tell you when it will be convenient to use a particular type of report.

View report in web browser


FullHtml - a full report to view the results of the analysis. It is possible to search and sort messages by type, file, level, code and warning text. A feature of this report is the ability to navigate to the location of the error in the file with the source code. The files with the source code, on which there were analyzer warnings, are copied into html and are part of the report. Examples of the report are shown in Figures 1-2.

Figure 1 - Example of the main page of the HTML report


Figure 1 - Example of the main page of the HTML report
')

Figure 2 - Viewing the alert in code


Figure 2 - Viewing the alert in code

It is convenient to send such a report in the archive or provide access to it over a local network using any web server, for example, Lighttpd , etc.

View report in the mail client


SimpleHtml is a lightweight report consisting of a single .html file. Contains brief information about the warnings found and is suitable for notification of the results by e-mail. An example of the report is shown in Figure 3.

Figure 3 - Example of a SimpleHtml page


Figure 3 - Example of a SimpleHtml page

Conclusion


Html reports can be very convenient in some scenarios of working with the analyzer, but they are not intended to configure and filter the analysis results. To do this, all settings must be made either in the analyzer itself (for example, excluding the catalog with libraries from the analysis) or in the report converter (choice of diagnostic types, warning levels, etc.).

To see what FullHtml looks like live, I converted one of the recent reports into this format, which I used when writing an article about the MuseScore project: MuseScoreHtml.7z .



If you want to share this article with an English-speaking audience, then please use the link to the translation: Svyatoslav Razmyslov. PVS-Studio Reports Now in Html

Read the article and have a question?
Often our articles are asked the same questions. We collected answers to them here: Answers to questions from readers of articles about PVS-Studio, version 2015 . Please review the list.

Source: https://habr.com/ru/post/342326/


All Articles