Validation expressions

Required role  Rule Management
Access  CodeChecker Server Rules Configuration →  Validation Expressions

Validation expressions are logical conditions used in the definition of a quality rule. During the code analysis, the validation expression is compared with the metric also defined in the quality rule to return a boolean value (true or false). The result of this comparison determines if the quality rule succeeds or fails.

ARCAD CodeChecker comes with a set of standard validation expressions that are designed to cover most needs. ARCAD CodeChecker also makes it possible to create specific validation expressions if needed.

Example

You want to create a quality rule to make sure Until statements are not used in a source code.

The validation expression Metric value is equal to uses a parameter to set the expected value for a metric. You will use this validation expression in the quality rule, and set the expected value to 0.

After the execution of the quality rule, if the metric value is 0, then the quality rule succeeds. However, if the metric value is different from 0, the quality rule fails because the metric value is not equal to 0, as the validation expression requires.

Reference

For more information about quality rules, refer to Quality rules.

For more information about metrics, refer to Metrics.

Validation expressions

The  Validation Expressions search view is accessed from the  Configuration node in the Navigator.

The standard validation expressions are highlighted to be easily identified.

Enter any combination of the above search criteria, then click the Search button to display the results. To display the complete list, click the Search button without entering any search criteria.