Set Baseline Polyspace as You Code Results in Visual Studio Code
To fix bugs more efficiently, use a Polyspace® as You Code analysis run as a baseline and compare subsequent analysis runs against that baseline. The comparison allows you to focus on only new results or on unreviewed results. You can compare Polyspace as You Code single-file analysis results against:
A local baseline that you create using a single-file analysis that you run in Polyspace as You Code.
An integration baseline that you create using previous Polyspace Bug Finder™ Server™ results that you download from Polyspace Access™.
Note
To keep using the most up-to-date integration baseline information, make sure that you periodically run the command to download results from Polyspace Access. See Step 3: Download Baseline.
What Using Baseline Results Looks Like
If you compare Polyspace as You Code results against a local or integration baseline, you can see the following benefits:
By default, only results that are new compared to the local baseline are shown.
If you toggle the baseline filter to show all results, the word
[baseline]
appears next to the result in the PROBLEMS panel.Integration Baseline Only
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 non-justified Status on Polyspace Access carry over all review information to the RESULT DETAILS view.
For example, if a defect has been reviewed and assigned a Status of To investigate and a Severity of Medium, the same review information appears in the
Comment from baseline
section in the RESULT DETAILS view.If a Polyspace as You Code result also appears in the integration baseline, you can open the project that you use as baseline in the Polyspace Access interface. Click in the BASELINE view. See Open Additional Polyspace Views.
You can also open the project on Polyspace Access by running Polyspace: Open Project in Access Web from the Command Palette.
If you use both a local baseline and an integration baseline, Polyspace compares the current results to the integration baseline first, but uses the local baseline to filter for new results.
Configure Local Baseline
To create a local baseline, right-click a file in the EXPLORER view or in the editor and select Create a local baseline. You can also create a local baseline by clicking in the QUALITY MONITORING view.
When you create a local baseline for a file filename
, Polyspace analyzes the file and
uses the analysis results as a baseline. The results of each subsequent analysis of
filename
are compared against that baseline.
See also Open Additional Polyspace Views.
Configure Integration Baseline
To use Polyspace Bug Finder Server results as baseline for a Polyspace as You Code analysis, follow the steps below. Once a baseline is downloaded, if you choose to point to the baseline, each subsequent run, whether on file save or on-demand, uses the baseline.
Step 1: Identify Project to Use as Baseline
First, identify a project in Polyspace Access 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:
Open the Polyspace Access web interface in a web browser.
On the Project Explorer pane, right-click the project and select Copy Project Path to Clipboard.
Step 2: Refer to Project from Polyspace as You Code
Next, refer to the Polyspace Access project from the Polyspace as You Code extension settings in Visual Studio Code.
Open the extension settings.
To open the baseline settings, press Ctrl + , (comma) and type
polyspace.baseline
in the settings search bar.Specify these settings on the User tab:
Baseline: Polyspace Access Login: The username that you use to log in to Polyspace Access.
Baseline: Polyspace Access Url: The URL of the server that hosts Polyspace Access. For instance,
https://my-access-url:9443/
.
Specify these settings on the Workspace tab:
Baseline: Project: 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
Explicitly download the Polyspace Access result to use as baseline.
Click in the BASELINE view or open the command palette (Ctrl + Shift + P) and select Polyspace: Download Baseline.
Enter the password that you use to log in to Polyspace Access. The baseline download begins.
You can view the progress of the download in the BASELINE view. See Open Additional Polyspace Views.
After download, subsequent runs use the baseline. To disable baseline usage, select
Show local findings only
in the Baseline: Show Baseline
Information drop down menu.