Coverity on Polaris CLI Scanning QuickStart Guide

Coverity on Polaris

Version
latest
You can get started with Coverity on Polaris command line scanning right away using the following processes.

Scanning a project without configuring project settings

  1. In the Coverity on Polaris Web Interface, go to Downloads > Polaris CLI Tool. Download the Coverity on Polaris CLI tool for your OS. See Installing Command Line Tools on Coverity on Polaris.
  2. Unzip file or double-click the pkg file and follow insructions.
  3. Add the Coverity on Polaris executable to your path so you can execute it from anywhere on the system. For example: export PATH=/Users/UserName/Downloads/polaris_cli-macosx-1.7.83/bin:$PATH.
  4. Navigate (change directory) to the directory containing the source code to be analyzed.
  5. Run the command polaris analyze -w to analyze the entire directory.
  6. Input your Coverity on Polaris URL and access token. You can generate an access token from within your Coverity on Polaris instance by clicking your user name in the top of the left navigation panel, and selecting Access Tokens > +Create New Token. See Generating an Access Token.
  7. When your scan is complete, copy and paste the URL at the end of your scan results into a browser address bar, and press Enter. This displays your scan results in Coverity on Polaris.

Scanning a project and configuring the Coverity on Polaris yml file with your project settings

  1. Follow steps 1 through 4 in the preceding section.
  2. Instead of running the analyze command in step 5, run the setup command polaris setup to create a configuration .yml file in the scan directory.
  3. Provide the URL for your Coverity on Polaris system.
  4. Provide the access token you created in the previous section. Or you can generate a new access token by clicking your user name in the top of the left navigation panel and selecting Access Tokens > +Create New Token.
  5. Optional: Navigate to your scan directory, and locate the file polaris.yml. Open the yml file in a text editor to edit the project name, specify the files to get picked up, and other project variables. After making your edits, save and close the file.
  6. Then run the analyze command: polaris analyze -w.
  7. When your scan is complete, copy and paste the URL at the end of your scan results into a browser address bar, and press Enter. This displays your scan results in Coverity on Polaris.

For more information