If you use an unsupported IDE, you can check for various types of defects and coding rule violations by using Polyspace® as You Code at the command line. See Defects and Coding Standards. The default analysis checks for a subset of defects. See Polyspace Bug Finder Defects Checkers Enabled by Default. To check for other defects and coding rule violations, configure Polyspace as You Code.
To configure checkers, create a checkers file and then specify the checkers file at the command line. For equivalent workflows in the Polyspace desktop and server, see Prepare Checkers Configuration for Polyspace Bug Finder Analysis (Polyspace Bug Finder Server).
When running Polyspace as You Code in an unsupported IDE, you can specify a selection of checkers and coding rules by using these analysis options with appropriate values directly at the command line:
For instance, to activate the performance checkers and MISRA C:2012 coding rule, in the command line interface, run
polyspace-bug-finder-access -sources <source.c> -checkers performance -misra3 all
polyspace-results-export.Specifying checkers and coding rule selection enables you to select predefined subsets of checkers and coding rules. To select a customized subset of checkers and coding rules, configure checkers by using a checker file.
![]()
To configure checkers, first select checkers in a checkers file. Then specify the checkers file in the Settings pane.
To enable nondefault defects and coding rules, you might:
Create or modify a checkers file.
Import a checkers selection from a Polyspace desktop project.
Create or Modify Checkers Configuration. Create a new selection or modify an existing selection of checkers and coding rules in the Checker selection window. Save the new configuration in a reusable checkers file. To use an existing checkers file without modifying the checkers selection, specify it at the command line. See Step 2: Specify Checker File at the Command Line.
To open the Checkers selection user interface, in the command line, run:
polyspace-checkers-selection

To create a new selection, in the Checkers Selection window, select the defect and the coding rule checkers that you want to activate. To modify an existing selection, click Browse, navigate to the existing checkers file and then make your selection.
You can also activate predefined categories of defect checkers such as All, Default, High, Medium, Low, and CWE. See Classification of Defects by Impact. Similarly, you can activate predefined set of coding rules that are defined by their corresponding standards.
When selecting Guidelines > Software Complexity checkers, review their thresholds. If
the default thresholds are not acceptable, specify a
suitable threshold in the
Threshold column. See
Check Guidelines
(-guidelines).
When selecting Custom
rules, review the Pattern
and Convention for the
rules. See Check custom rules
(-custom-rules).
Save the selection as a reusable checkers XML file as
and then Finish. You can later reuse
CreatedCheckerFile.xml
as a value to CreatedCheckerFile.xml-checkers-activation-file.
![]()
Import Checkers Configuration from Desktop Project. If you have a Polyspace desktop Project (*.psprj) file,
you can import checker selection from it. At the command line,
run
#Linux command polyspace-checkers-selection -checkers-selection-output-file\ -import-options-from-psprjPathToOutputFile.json#DOS command polyspace-checkers-selection -checkers-selection-output-filePathToProject.psprj\ -import-options-from-psprjPathToOutputFile.jsonPathToProject.psprj
PathToProject.psprj is
the full path to the polyspace desktop project file and
PathToOutputFile.json
is the full path to a JSON file. The JSON file must be in
a writable folder. The JSON file contains the location of the produced
checkers file in this
format: {
"checkers-activation-file": "PathToCreatedCheckerFile",
"analysis-options-file": "CreatedOptionsFile"
}
PathToCreatedCheckerFile
contains the checker configurations in the Polyspace desktop project file. ![]()
After you obtain the checkers file, specify its full path as an argument to
-checkers-activation-file. For instance:
#Linux command polyspace-bug-finder-access -sources <source.c> \-checkers-activation-file#DOS command polyspace-bug-finder-access -sources <source.c> ^PathToCreatedCheckerFile-checkers-activation-filePathToCreatedCheckerFile
PathToCreatedCheckerFile
is the full path to the checkers file.To modify the default behavior of Bug Finder defect checkers and coding rules, use analysis options. For a list of analysis options that modify the default checker behavior, see Modify Default Behavior of Bug Finder Checkers (Polyspace Bug Finder Server).
To specify analysis options in Polyspace as You Code:
Use the options in the command line. For instance, to modify the trust boundary of your analysis, in the command line, run:
polyspace-bug-finder-access -sources <source.c>-checkers-activation-file-consider-analysis-perimeter-as-trust-boundaryCreatedCheckerFile
Append the analysis options in the options file specified in the field
Analysis options file. An options file is
a text file with one analysis option for each line. For instance, to add
the analysis options -code-behavior-specifications and Effective
boolean types (-boolean-types), in the options file,
append these
lines:
-code-behavior-specifications file1 -boolean-types boolean1_t,boolean2_t
If you do not have an existing options file, create an options file containing the necessary options. See Options Files for Polyspace Analysis.