Main Content

Configure Checkers for Polyspace as You Code in Eclipse

You can check for various types of defects and coding rule violations by using Polyspace® as You Code in Eclipse™. See Defects (Polyspace Bug Finder) and Coding Standards (Polyspace Bug Finder). The default analysis checks for a subset of defects. See Polyspace Bug Finder Defects Checkers Enabled by Default (Polyspace Bug Finder). To check for nondefault defects and coding rule violations, configure Polyspace as You Code extension in your IDE.

To configure checkers, create a checkers file, and then specify the checkers file in the Configure Project window. For equivalent workflows in the Polyspace desktop and server, see Prepare Checkers Configuration for Polyspace Bug Finder Analysis (Polyspace Bug Finder).

Select Checkers and Coding Rules

To select coding rule checkers and nondefault defect checkers, click the Configure Checkers icon in the Configuration View of the Polyspace as You Code perspective. Configure the checker selection in the Configure Project window.

Polyspace Project Configuration menu for Eclipse plugin

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.

  1. In the Configuration view of the Polyspace as You Code perspective, open the Checkers selection window by clicking Configure checkers icon.

    Polyspace Checkers selection interface

  2. 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 modify the checkers selection.

    You can also select predefined categories of defect checkers such as All, Default, High, Medium, and Low. See Classification of Defects by Impact (Polyspace Bug Finder). Similarly, you can activate a 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) (Polyspace Bug Finder).

    • When selecting Custom rules, review the Pattern and Convention for the rules. See Check custom rules (-custom-rules) (Polyspace Bug Finder).

    • To create a custom coding standard classification, or to tag Bug Finder or coding rule checkers of interest, enter text in the Comment column of the Checkers selection window. Polyspace displays that text in the Results Details pane and in the Detail column of the Results List (if available) when you review results in the desktop interface, in Polyspace Access™, or in the Polyspace as You Code plugins.

      Note

      The custom text that you enter in the Checkers selection interface is omitted in:

      • Generated reports.

      • The Polyspace desktop interface when you open results from Polyspace Access in the desktop interface. This limitation applies only to Bug Finder checkers.

  3. Save the selection as a reusable checkers XML file by clicking Save Changes. After you click Finish, the path to the new checkers XML file is specified in the field Checkers file in the Configure Project window.

Import Checkers Configuration from Desktop Project

You can import checkers and coding rule configuration from a Polyspace desktop project (*.psprj) file. See Import Analysis Options from Polyspace Desktop Project.

Modify Checker Behavior

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).

To specify analysis options in Polyspace as You Code:

  • 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 (Polyspace Bug Finder) and Effective boolean types (-boolean-types) (Polyspace Bug Finder), in the options file, append these lines:

    -code-behavior-specifications file1
    -boolean-types boolean1_t,boolean2_t

  • If you do not have an option file, create an option file that contains the necessary options. Specify the path to the new options file in the field Analysis options file. See Options Files for Polyspace Analysis (Polyspace Bug Finder).

Related Topics