In order to make the checks reflect your coding guidelines, you need to edit the check configurations. When running Code Checker for MATLAB for the first time, a configuration file with default values for all checks will be created and activated.
Accessing the configuration fileThe configuration file (XML) can be accessed in the following ways:
- In the GUI on the Configuration tab, select the configuration file you want to use and click the Edit button
- In a report, there are several links to the configuration file that was used for the Code Checker for MATLAB run:
- In the Meta data section at the top of the report, click the Edit button on the Configuration file row.
- At a results table, click Edit check configuration to open the configuration file at the position of that specific check.
- At a results table, click Edit after a parameter's name to open the configuration file at the position of that parameter.
- In the command window, type edit(monkeyproof.cc4m.getActiveConfigurationFile(‘full’))
Editing the configuration fileThe configuration file contains multiple elements, most of which can be edited. For example, you can disable a check by changing the value of its
<enabled> element to 0 or attach a link to the guideline using the
guidelineLink element. To configure a parameter, go to the relevant
<parameter> element in the configuration file and change the value or description. Keep an eye on the parameter's constraints defined by
alloweditem or
allowedmin/allowedmax elements. Changing these constraints in the configuration file has no effect because they are only there for reference.
The following things can be configured for every check:
- Description
- Category
- Guideline ID and link
- Enabled/disabled
- Priority
- For every parameter of the check:
Using the edited configuration fileAfter editing the guideline configurations file, save it and just start a Code Checker for MATLAB run. Any changes will be applied immediately.