Rule Compliance

Concept

Rule Compliance indicates how well the project development team follows the coding guidelines. A rule is not compliant if at least one unjustified violation is detected. If a violation is relaxed/justified using the "relaxation feature", it will not impact rule compliance. For this KPI, Squore only takes into account rules which nature is categorized as "Non Conformity".

SWAN rule compliance findings
Figure 1. Rule Compliance - Findings

Formula

Rule Compliance = (#violated rules / #Verified Rules)

Where: * "Violated rules" is the number of rules for which there is at least 1 violation * "Verified Rules" is the number of rules which were checked during static code analysis

Side Effect of External Data Provider

The list of "verified rules" depends on the static code analysis and thus, depends on the external tools results which are imported in the Squore project with Data providers.

Example:

  1. Using ‘Squore Analyzer’ Data provider only: Total verified rules is 19 (for C language)

  2. Using ‘Squore Analyzer’ + ‘PCLint’ Data providers: Total verified rules is 152.

Rule Compliance may drastically vary, depending on the static code analyzers used on the project.

Note: Squore dynamically create the ruleset based on the selected Data Providers. For instance, MISRA Checker will not be counted in the "verified rules" if no MISRA analyzer are called.

SWAN rule compliance rating impact
Figure 2. Rule Compliance - Rating Impact of Data Providers

The reason comes from the "verified rules" which drastically changed:

SWAN rule compliance rating before
Figure 3. Rule Compliance - Rating with Squore only
SWAN rule compliance rating after
Figure 4. Rule Compliance - Rating with Squore and PCLint

Settings (Ruleset Template)

After selection of the Data Providers, Squore provides an interface to tune the ruleset in order to enable/disable specific rules.

SWAN rule compliance template ruleset
Figure 5. Rule Compliance - Ruleset Template

It is possible to create a template to share this ruleset configuration between projects.

Relaxing a Violation

Relaxation From the Squore GUI

It is possible to relax a violation or a group of violations within Squore.

SWAN rule compliance relaxation
Figure 6. Rule Compliance - Findings Relaxation

Note: Make sure you have selected the "Current" version of the project. Indeed, it is not possible to modify/update a baseline version.

Relaxation Imported from External Tools

Squore can manage justifications which have been provided outside Squore environment. This mechanism is handled by the Data Provider, which detects justifications from the data it analyzes, and injects them into Squore.