DEV Community

Unicorn Developer
Unicorn Developer

Posted on • Edited on

How to get and use free PVS-Studio license. Part 1: Preparing and getting started

Many developers have heard of PVS-Studio static analyzer, but not everyone knows they can use it for free on a permanent basis. This article breaks down different free licensing options, explains who they're good for, and details how to get started with the tool.

1286_PVS_4FREE_CH1/image1.png

Introduction

PVS-Studio is a tool for detecting potential errors and vulnerabilities in C, C++, C#, and Java code. It runs on Windows, Linux, and macOS and offers a wide range of integration scenarios—from IDE plugins to the use in version control or code quality systems. In the enterprise segment, PVS-Studio is a paid B2B solution used by many teams and companies around the world.

The PVS-Studio team does more than just develop the analyzer. For 17 years, we've participated in developing the technical community and helping improve the quality and reliability of open-source software. We regularly check community projects, and our articles have helped fix numerous errors.

There are many non-commercial projects run by enthusiasts who care about code quality. However, we can't check them all, especially since they aren't always publicly available. That's why we've introduced several ways to get PVS-Studio for free.

We'll release a series of articles on this topic. The first part discusses the basic licensing terms and conditions and provides a tutorial on how to get started with the analyzer. In other parts, we'll cover how to use and customize the tool for your project. Of course, we'll also break down the errors detected by the analyzer in real projects.

Note. Before anyone suggests a "simpler" method involving individual licenses, I'd like to point out that we've already tried that. It didn't work out :) If you'd like to know more about the results of that experiment, I suggest checking out this article.

How to get a license

There are several ways to obtain a free PVS-Studio static analyzer license:

  • for open-source projects;
  • for proprietary projects;
  • for students and teachers;
  • for security experts;
  • for Microsoft MVPs.

Let's take a closer look at each option.

Note. The methods described in this article are NOT suitable if you just want to check PVS-Studio! To try out the tool, you need a trial key, which you can get on this page. Choose one of the options described in this article only if you decide to regularly use PVS-Studio for free.

For open-source projects

If you're working on an open-source project, you can receive a free, unrestricted PVS-Studio license.

This is the easiest and most popular way to use the analyzer for free on a permanent basis. We recommend using it if you have an open-source project.

Please note that the project must be hosted on GitHub, GitLab, or Bitbucket. Getting a license requires:

  1. visiting this page and reading the licensing terms;
  2. meeting the licensing conditions (mentioning PVS-Studio in REAMDE.md, etc.);
  3. entering the required information (an email, a project link);
  4. submitting a request for a free license;
  5. using the same method once the license expires to obtain a new license key.

Note. You can learn more about the licensing terms in the following article: "Use PVS-Studio to analyze open-source projects".

This method requires that you mention PVS-Studio in the README.md file, as well as in the commits and pull requests. If this doesn't suit you, you can use the way described in the "For proprietary projects" section. It involves adding comments to the code.

For proprietary projects

Note. The free licensing option that required adding special comments to the code is no longer supported.

For students and teachers

Note. The student licensing program has been temporarily suspended. To stay updated on new licensing options, you can subscribe to our newsletter.

For security experts

Public cybersecurity experts, such as those involved in vulnerability research, can contact us to receive a free license for PVS-Studio analyzer.

To obtain and maintain it, you'll need to confirm your experience and involvement in the field of security. You can demonstrate this through articles, publications, and other relevant materials. These details will be clarified during the communication process.

For more information on this licensing method, see the "Handing out PVS-Studio Analyzer Licenses to Security Experts" article.

For Microsoft MVPs

We respect the efforts of MVP experts in the IT community, and we want to support those who contribute positively to the field of IT.

So, if you're a Microsoft MVP, we'd love to give you a free PVS-Studio license for a year. Then you can renew it.

You can submit your request on this page.

Getting started

First, prepare an environment that supports PVS-Studio analyzer. The documentation lists the system requirements and supported integrations.

After fulfilling all the conditions of the selected licensing option and receiving the key, you can begin the installation process. The stages depend on how and where you use the analyzer.

We will use OSU!—a well-known open-source C# game—as the test project to examine the experience of the first run. As the IDE for integrating the PVS-Studio plugin, we'll use Visual Studio 2022.

Note. You can use PVS-Studio static analyzer in more ways than just an IDE plugin. There are many use cases, including integration with CI/CD systems, code quality and security verification systems, and game engines. See our main page for a full list of possible use cases.

Installation process

For example, let's look at the scenario of installing a Visual Studio plugin from the Marketplace.

First, open the Manage Extensions menu in Visual Studio by navigating to Extensions > Manage Extensions. Then, enter PVS-Studio in the search field. The plugin will appear in the search results:

1286_PVS_4FREE_CH1/image2.png

Then, click the Download button to start the automatic download of the PVS-Studio installer for Windows. It includes the plugin, the analyzer core, and auxiliary tools.

The installer will prompt you to close all active processes in the available development environments and provide a selection of plugins for each installed IDE.

1286_PVS_4FREE_CH1/image3.png

How to enter a license

After the installation, the first step is to enter the license.

The installer will prompt you to enter the license information and activate it. You can do this immediately or later via the plugin menu. Enter the key you obtained in the "How to get a license" step:

1286_PVS_4FREE_CH1/image4.png

If you followed the instructions for using comments in the code (see "For proprietary projects"), enter the following key:

The activation key

License Name: PVS-Studio Free

License Key: FREE-FREE-FREE-FREE

1286_PVS_4FREE_CH1/image5.png

Note. See the documentation for details on how to enter the license.

Once the license is activated, the analyzer is ready for use.

Let's not get ahead of ourselves, though. Yes, you can start analyzing a project right away because our tool works out of the box. However, we strongly recommend taking the time to configure it by limiting the files for analysis, enabling or disabling various diagnostic rules, etc. This will not only enhance the analyzer performance but also minimize the false positive rate. In the next part, we'll dive deeper into the topic of configuring the tool and working with reports. For now, feel free to check the documentation.

If you have any questions about the licensing policy or other issues, please ask them in the comments section below the article or via the feedback form.

Top comments (0)