After installing the Polyspace as You Code analysis engine and IDE extension, configure the extension so that a Polyspace® analysis runs smoothly when you save your code or explicitly start an analysis. An analysis has run smoothly if results appear as expected, either as source code markers with tooltips or in a list on the PROBLEMS pane.
To configure the extension, in Visual Studio Code, open the settings interface by
pressing Ctrl + , (comma) and
type polyspace in the settings search bar.
For each setting, you can specify a value that applies globally to all workspaces or folders that you open in the Visual Studio editor. For some of the settings, you can also override the global specification with a workspace-specific value.
To specify global settings, enter the settings on the User tab.
To override the global settings for the currently open workspace or folder, enter the settings on the Workspace tab.
![]()

![]()
To reset a setting to its default value, click the
icon on the left of the setting and select
Reset Setting. All settings retain their current values when
you reinstall the extension.
Tip
Type the Setting ID in the settings search bar to view only the settings related to that ID.
![]()
Setting ID:
polyspace.analysisengine
These settings are mandatory.
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Polyspace Installation Folder | Root folder of the Polyspace as You Code installation, for
instance, C:\Program Files\Polyspace as You
Code\R2021a. | No |
| Result Folder | Folder where analysis results are stored. Each new run overwrites results of the previous run. | Yes |
![]()
Setting ID:
polyspace.analysisoptions.analysislaunchmode
By default, Polyspace as You Code runs each time you save your code. You can choose to disable the automatic runs.
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Analysis Options: Analysis Launch Mode | Select when Polyspace as You Code must run:
| Yes |
![]()
Setting ID:
polyspace.analysisoptions.analysissetup
You can set up a Polyspace as You Code analysis through extension settings or override extension settings and run a script instead. By default, the analysis uses extension settings.
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Analysis Options: Analysis Setup | Select between manual setup and script.
| Yes |
![]()
Setting ID:
polyspace.analysisoptions.manualsetup
Manual setup of the analysis involves specifying build options, checkers and other analysis options. Extract build options from a Visual Studio Code build task or a JSON Compilation Database file, or specify them explicitly in a build options file. Enable or disable checkers in a checkers selection window. Specify all remaining analysis options explicitly in an options file.
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Analysis Options > Manual Setup: Build | Specification of build-related Polyspace analysis options. Options are:
| Yes |
| Analysis Options > Manual Setup > Build Setting: Build Command | Use this setting if you choose Specify the build command name exactly as you would enter on a command-line terminal or console. Use a build command that performs a complete build of all files in your workspace and not an incremental build. | Yes |
| Analysis Options > Manual Setup > Build Setting: Build Task | Use this setting if you choose Specify the build task name. The build task name is the name of a command that runs when you select Terminal > Run Task. For more information on tasks, see Visual Studio Code documentation. Use a build task that performs a complete build of all files in your workspace and not an incremental build. | Yes |
| Analysis Options > Manual Setup > Build Setting: JSON Compilation Database File | Use this setting if you choose Specify the full path to a
database file (typically named
| Yes |
| Analysis Options > Manual Setup > Build Setting: Polyspace Build Options File | Use this setting if you choose Specify the full path to a Polyspace build options file. The options file is a text file with one Polyspace analysis option per line. See also Options Files for Polyspace Analysis. | Yes |
| Analysis Options > Manual Setup: Checkers File | Specify the full path to a checkers configuration file. To create this file, in the Command Palette, run Polyspace: Configure Checkers. Enable the checkers that you want and save the file. See also Configure Checkers for Polyspace as You Code in Visual Studio Code. | Yes |
| Analysis Options > Manual Setup: Other Analysis Options | Path to an options file. The options file contains one Polyspace analysis option per line. For example: -termination-functions exit_handler -code-behavior-specifications /usr/jdoe/util/checkerModifiers.xml You
typically do not need to specify additional options in an
options file. However, in some situations,you might want to
use an options file. For instance, you might want to modify
some checkers using an XML file that you provide with the
option
See also Options Files for Polyspace Analysis. | Yes |
![]()
Setting ID:
polyspace.analysisoptions.scriptfile
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Analysis Options > Script: Script File | Use this setting if you choose
Enter the full path to a script. The script can be written in any language and runs each time you run Polyspace as You Code on file save or explicitly. The script takes the path to the current file as the first argument and the Result Folder as the second argument. For example, this simple Windows batch script analyzes the current file, uses the default Polyspace build options, and imports the review information from a previously downloaded baseline: Use a script if, for instance, you switch between files from components that have different build configurations or you use a custom tool to setup your build environment. If you enable this setting, all other extension settings are ignored. Note The Polyspace as You Code extension does not check the
exit status of the commands in your script. Make sure
your script checks exit codes (for instance by using
Typically, the Polyspace binaries return 0 on success and a non-zero value on failure. | Yes |
![]()
Setting ID:
polyspace.baseline
These options are essential only if you want to obtain a baseline from Polyspace Access. After you obtain a baseline from Polyspace Access, subsequent runs of Polyspace as You Code allow you to distinguish between new results and results that were present in existing code. See also Baseline Polyspace as You Code Results in Visual Studio Code.
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Baseline: Polyspace Access Url | Specify Polyspace Access URL. | No |
| Baseline: Polyspace Access Login | Specify the user name you use to log in to Polyspace Access. Later, when you run Polyspace: Get Baseline in the Command Palette, you are prompted for the password corresponding to this user name. | No |
| Baseline: Project | Specify a project on Polyspace Access that you use as baseline. Later, when you run Polyspace:
Get Baseline in the Command
Palette, the | Yes |
| Baseline: Show Only New Findings | Suppress findings that are already present in the Polyspace Access project that you use as baseline. If you select this setting, you must also select Baseline: Use Baseline. | Yes |
| Baseline: Use Baseline | Use Polyspace Access project as baseline. Results that are already present in Polyspace Access show associated review information. If a result has review information that indicates a justified status, for instance, No action planned, the result is not shown at all. In addition, if you select the setting Baseline: Show Only New Findings, results that are already present in Polyspace Access are not shown at all. | Yes |
![]()
Setting ID:
polyspace.trace.server
The option is useful only for troubleshooting by technical support. You typically do not need to use this option.
| Setting | Description | Available Per Workspace? |
|---|---|---|
| Trace: Server | Whether the log must show messages related to communication between the internal server that hosts analysis results and the IDE. This option is only useful for troubleshooting internal communication issues. | Yes |
![]()