Configuring code review rules

The code review tool uses a set of predefined rules. You can select the default rule configuration file for the code review tool. MISRA 2004 and MISRA 2012 from HCL OneTest™ Embedded V8.2.0 are the default installed rule configuration files. You can disable or set the severity level to Warning. You cal also configure the entry-point option if your application is multi-threaded.

About this task

By default all rules are enabled and produce either an error or a warning in the code review report. You can save multiple customized rule policies. The default rule policy files MISRA 2004 and MISRA 2012 are located in: <installation directory>/plugins/Common/lib/confrule.xml. Do not modify the default rule configuration files. The only change that can be done in the default rule configuration files is to change or disable the severity level of the rule.
Note: For all new projects, you must select the configuration file that must be used. When you make any changes to the rule policy file, you can save the new policy file in the project.

To select the configuration file and disable or set the severity level of code review rules:
In the project explorer, right-click the project on which you want to change the settings and click Properties.
Click C/C++ Build > Settings and select Build Settings.
Expand Code review to access the code review settings.
Click Browse ... to select a rule configuration file. Select the default MISRA 2004 or MISRA 2012 rule configuration file that are installed with the product. Alternatively, click + to select a new rule configuration in your browser. Click OK. The path to the selected rule configuration displays in the value column on the Rule Configuration line.
In the Rule configuration line, click the configuration file button to open the Rule Configuration window.

On the left, select the rule that you want to configure. Rules are grouped into categories. When a rule is selected, its description is displayed on the right.

On the right, select the severity level:
Disabled: The selected rule is ignored and is not displayed in the code review report.
Warning: When the rule condition is found, a warning is displayed in the code review report.
Error: When the rule condition is found, an error is displayed in the code review report.
Select Show only the first occurrence to only show the first occurrence of a rule condition in a file. Any subsequent occurrences of the condition are not reported.

If your application is multi-threaded, you can provide the list of entry points to avoid that the rules about 'non-used functions' are raised.

To configure the Multi_thread option, follow these steps:
In the project explorer, right-click the project on which you want to change the settings and click Properties.
Click C/C++ Build > Settings and select Build Settings.
In the right panel, click SettingsGeneral > Multi-Thread option.
Click ... in the value field of the Entry points option to open the editor.
In the editor, enter the list of entry points for each thread and click OK.
Click OK, Apply the changes and close the Properties window.
Note: The Entry point option applies to rule E16.50 (MISRA_2004) and M2.2.2 (MISRA 2012).
Feedback