Dialog: Static Analysis Settings: Rules

Function: In the dialog, you select the rules that are checked during the static analysis of the source code of a project. For more information,see: Configuring and Running Static Analysis

Call:

Requirement:

This tab shows a tree structure of all rules that can be checked during static analysis. By default, every rule is activated, with the exception of SA0016, SA0024, SA0073, SA0101, SA0105, SA0106, SA0133, SA0134, SA0150, SA0162, and all "strict IEC rules".

Each rule has a unique number. When the rule is checked and a violation is detected, the rule number and an error description are shown in the message view in the Build category in the following format: SA<rule number>, where "SA" stands for "Static Analysis" (example: "SA003" for rule 3).

TIP:

The list of available rules can be extended by specific plug-ins.

Some rules that are activated in the dialog can be deactivated temporarily in the application by applying a pragma.

When you click the check box, the setting toggles between , , and .

When you activate or deactivate a parent node, all child rules are also activated or deactivated, respectively.

Filter:

  • Input field for the strings to be searched for

  • : Rules are grouped by category.

    • Structured by Importance: Sorting by Importance High, Importance Medium, and Importance Low

    • Default: Default structuring of the rules in CODESYS Static Analysis

  • : Rules are displayed as a flat list. By clicking on the corresponding column header, the list can be sorted by rule number, activation/deactivation, rule-specific configuration, or importance.

Columns

 

Rules

List of rules with rule number

Rule check

  • : The rule is not checked.

  • : If the result of the check is positive, then an error () for the static analysis is issued in the message view.

  • : If the result of the check is positive, then a warning () for the static analysis is issued in the message view.

Precompile

Rules which can be checked during precompile are identified by a check mark ( ) in this column.

An immediate bugfix (Quickfix) is possible for these rules. You can execute an automatic, immediate error handling directly at the affected code positions.

Rule specific configuration

For some rules, you can double-click the field to open a rule-specific dialog to configure the rule.

Importance:

Importance of the rule:

  • 3 red stars: High

  • 2 orange stars: Medium

  • 1 gray star: Low