4.2 Editing the configuration of a check
You can enable or disable checks by checking or unchecking the checkbox on their respective rows. You can also enable or disable all checks at once using the
Enable a
ll/none button right above the
Enabled column. Clicking a check’s name or description will display its configurations on the right, like shown in Figure
4.2↓. You can now see and/or edit the following:
-
The buttons Clone and Remove, will be discussed in 4.5↓.
-
The check’s description. This will also be displayed in Code Checker for MATLAB reports.
-
Whether or not to enable the check.
-
The priority of the check. Options are Recommended, Strongly recommended, and Mandatory.
-
Categories of the check. Use this to tie the checks to groups of coding standards. The value shall be a semicolon-separated list of categories.
-
A guideline link for linking the check to a guideline. Weblinks should start with https:// or http://.
-
The Go to button that goes to where the guideline link is pointing, if the guideline link field is empty, this button is disabled.
-
The guideline identifier.
-
If the check has configurable parameters, their names and descriptions are shown. By default, the first parameter in the table is selected and its details are shown below the table.
Selecting a parameter will show the parameter description and its value(s). By default, the first parameter of a check is selected (if there are any) when the check is selected in the checks table. Depending on the data type of the parameter, different components are used to edit the parameter value:
-
For boolean parameters, a switch to choose between True and False is shown. This is also shown in Figure 4.3↓.
-
For parameters of type double, a numeric text field is shown that applies the minimum and maximum values of the parameter.
-
If parameters of type string have any allowed values, a dropdown menu is shown that lets you select one value.
-
Parameters of type string that have no allowed values, a textbox is shown that lets you type the parameter value.
-
For parameters of type list, a dropdown menu is shown if there are allowed values. Depending on the parameter, one or more parameter values can be selected.
-
If there are no allowed values, parameter values of type list can be typed in a text box using one value per line.
Selecting a different check or parameter after editing one will store any edited values so these will not be lost. Clicking
Save or
Save as... lets you save the configuration file such that the updated configuration file can be used for checking your code. Please note that the configuration file is generated using the global description and the checks and parameters as they are in the Configuration Editor. This means that if your configuration file contained comments or empty lines before, they will no longer be there. If you are editing a predefined configurations file shipped with Code Checker for MATLAB (see Chapter
5↓), the
Save button will be disabled because it is not allowed to save configuration files in the folder for predefined configurations. You will have to save the file in a different location.