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

Request our prices
New License
License Renewal
--Select currency--
USD
EUR
GBP
RUB
* By clicking this button you agree to our Privacy Policy statement

Free PVS-Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

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

I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

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.

>
>
How to display Best Warnings
Analyzer diagnostics
General Analysis (C++)
General Analysis (C#)
General Analysis (Java)
Diagnosis of micro-optimizations (C++)
Diagnosis of 64-bit errors (Viva64, C++)
MISRA errors
AUTOSAR errors
OWASP errors (C#)
Additional information
Contents

How to display Best Warnings

Oct 06 2021

The PVS-Studio analyzer allows the user to easily view the Best Warnings of the analyzer. This mechanism helps you start working with the report simpler and easier. The Best Warnings are the warnings based on our most interesting and "dangerous" diagnostic rules. These warnings are most likely to report real errors.

Mainly, this mechanism helps learn more about the analyzer's features.

The Best Warnings mode does not substitute work with the analyzer full report. The full report may contain messages about potential errors, which also require attention.

Currently, the analyzer's Best Warnings feature only works in Visual Studio. However, we plan to add this mechanism to our other IDE plugins over time.

How it works

The mechanism filters the Best Warnings builds on the evaluation of the analyzer's triggerings. The evaluation follows a number of criteria called weights. Each diagnostic has an initial weight. This weight reflects the probability of the diagnostic to detect a significant (meaningful) error. We assigned the weights to the diagnostics in accordance with our extensive experience with static analysis and statistics we gathered when analyzing various projects. When we adjust these weights, we take into account the following:

  • the warning level;
  • the file name and directory name. We look for keywords indicating that the analyzer issued a warning for tests;
  • how frequent the same diagnostics appear in the project. It helps reduce the number of monotonous warning types;
  • the number of warnings issued per line of the same file.

As a result, we get a list of "warning-weight" pairs. From this list, the mechanism filters no more than ten "heavy" warnings.

Windows: Visual Studio (C, C++, and C#)

The PVS-Studio plugin for Microsoft Visual Studio is conveniently integrated into the IDE. This plugin allows you to run the analysis of the entire solution, specific projects, or individual files. It also supports incremental analysis.

You can access the Best Warnings mechanism in Visual Studio's special window that provides analysis results:

BestWarnings/image1.png

This window appears automatically, for example, when you run a project analysis. If you need to display it manually, then use the PVS-Studio extension settings:

BestWarnings/image2.png

The window itself allows you to navigate through the warnings that the analyzer found. It also allows you to navigate to the code that needs to be fixed. The window also provides advanced filtering and sorting capabilities for you to analyze the results most efficiently. Additionally, you can quickly go to the documentation of selected diagnostics.

To display the Best Warnings, open a secondary menu. Click on the hamburger button in the upper left corner:

BestWarnings/image3.png

In the panel that appears, click its "Best Warnings" button:

BestWarnings/image4.png

As a result, the window shows only the Best Warnings. If you click again, the window shows all the errors that the analyzer found.

Additional links

If you are new user, we also recommend reading the following articles:

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