Main Content

Set Baseline Polyspace as You Code Results in Visual Studio

For more efficient bug fixing, you can create a baseline of a Polyspace® as You Code analysis by using previous analysis results. When you set a baseline result, you can compare your baseline results against the results of a previous run and focus on new results only or on unreviewed results only. You create a baseline Polyspace as You Code result using previous Polyspace Bug Finder™ Server™ results that you download from Polyspace Access™.

Note

To keep using the most up-to-date baseline information, make sure that you periodically download results from Polyspace Access. See Step 3: Download Baseline.

Results that appear in Polyspace Access act as baseline for a Polyspace as You Code analysis.

Benefits of Using Baseline Results

Creating a baseline Polyspace as You Code result using Polyspace Bug Finder Server results that you downloaded from Polyspace Access, provides the following benefits:

  • Results that have a justified Status on Polyspace Access (No Action Planned, Justified, or Not a Defect) are no longer shown.

  • Results that have a nonjustified Status on Polyspace Access carry over all review information to the Polyspace Results List pane in Visual Studio®. If a result is reviewed in Polyspace Access and marked as such, one of the following is true:

    • Status is different from Unreviewed.

    • Severity is different from Unset.

    • Comment is not blank.

  • If you enable the Polyspace as You Code extension setting Show new findings only, you see only results that are new in the current run. By enabling this setting, you can focus only on results that occurred explicitly because of the changes you made since the last Polyspace Server run.

Setting Baseline Steps

To use Polyspace Bug Finder Server results as baseline for a Polyspace as You Code analysis, follow these steps. If you choose to point to a downloaded baseline, each subsequent run uses the baseline.

Step 1: Identify Project to Use as Baseline

Identify a project in Polyspace Access with results that you want to use as baseline. The project must contain results of a Polyspace Bug Finder Server analysis on files that you will analyze in Polyspace as You Code.

Copy the path to the project for use in the Visual Studio Code extension settings. To copy this path:

  1. Open the Polyspace Access web interface.

  2. On the Project Explorer pane, right-click the project and select Copy Project Path to Clipboard.

Context menu showing Copy Project Path to Clipboard option

Step 2: Point to Project from Polyspace as You Code

Point to the Polyspace Access project from the Polyspace as You Code extension settings in Visual Studio.

  1. Select Tools > Options to open the Options dialog box.

  2. Select the Polyspace as You Code > Baseline node and configure these settings:

    • Select an option from the Show Baseline Information list:

      • Show local findings only — Do not use the baseline.

      • Show local findings and baseline info — After you download a baseline, findings that are already justified in the baseline run are suppressed in the Error List view.

      • Show new findings only — After you download a baseline, findings that are already present in the baseline run are suppressed in the Error List view. Use this option to focus only on new findings in your file.

    • Polyspace Access URL — The URL of the server that hosts Polyspace Access, for example, https://my-access-url:9443/.

    • Polyspace Access Login — The username that you use to log in to Polyspace Access.

    • Project path — The path to the project in Polyspace Access that you want to use as baseline. You previously copied this path from the Polyspace Access web interface.

Step 3: Download Baseline

Download the Polyspace Access results to use as baseline.

  1. The first time you configure the extension settings, click Download Baseline icon in the Baseline view of the Polyspace as You Code perspective.

    Click the same icon to download an updated baseline. The icon is available only if you configure the extension to use a baseline.

  2. The extension prompts you to enter your Polyspace Access password. You have the option to save the password so that you no not need to enter it in subsequent downloads.

An indicator in the Baseline view shows the progress of the download. If there are issues with the download, check the Output pane and select Show output from Polyspace as You Code for details.

After the download is complete, subsequent runs use the baseline. To disable baseline usage, set Show Baseline information to Show local findings only.

Related Topics