Up Pro features

6.1 Run from the command window

Calling monkeyproof.cc4m.start without input arguments opens the graphical user interface that lets you choose what files to check and how. Almost all of these options are also available from the MATLAB command window. In the different options and syntaxes described in this chapter, character vectors and cell arrays thereof are used. The same options can also be used using strings and string arrays.

6.1.1 Select files for checking

The file(s) or folder to run the Code Checker for MATLAB on can be set using the following syntaxes:
>> monkeyproof.cc4m.start(’file’, location);
Runs the checks on the file(s)/folder location (absolute path).
Instead of providing the file/folder/project to check directly in the input, the following options can be used:
>> monkeyproof.cc4m.start(option);
Where option can be one of the following:

6.1.2 Additional options

The runPriorities parameter can be used to run only the checks with the given priorities. The syntax for doing this is as follows:
>> monkeyproof.cc4m.start(..., ’runPriorities’, {’Recommended’, ’Strongly recommended’});
This would run all checks (that are not disabled by your configuration file) with priority Strongly recommended and Recommended. The supported priorities are: Mandatory, Strongly recommended, and Recommended. If the parameter is omitted from the inputs, checks with all priorities will run. This option applies check filtering on top of what is configured in your configuration file.
The runSeverities parameter can be used to run only the checks with a severity level below or equal to the maximum level set. The syntax for doing this is as follows:
>> monkeyproof.cc4m.start(..., ’runSeverities’, 5);
This would run all checks (that are not disabled by your configuration file) with a severity level between 1 and 5. The supported severities are in the range of 1 through 10. The most important ones are of severity level 1 and next levels are reserved for more pedantic issues. If the parameter is omitted from the inputs, checks with all severity levels will run. This option applies check filtering on top of what is configured in your configuration file.
Additional options can be provided as input arguments to further customize the run. The syntax is as follows:
>> monkeyproof.cc4m.start(..., option1, ..., optionN);
where option1 through optionN can be the following:
Additionally the file location of the created report can be returned:
>> fileLocation = monkeyproof.cc4m.start(...);
Setting the MATLAB path
In order to make sure that the right folders are on the MATLAB path at the time of checking, an additional input parameter can be provided. The syntax is as follows:
>> monkeyproof.cc4m.start(’matlabPath’, ’C:\Files\myFolder;C:\AnotherFolder’);
>> monkeyproof.cc4m.start(’matlabPath’, ’C:\Files\MyDocuments\MyPath.txt’);
The MATLAB path to set can be a semicolon-separated character array of the different parts of the path. Alternatively, the path can be provided in a txt-file. This text file can have the different parts of the path on separate lines, or they can be separated by semicolons.
The path used during the Code Checker for MATLAB run is set as follows:
  1. Keep all folders that contain MATLAB-installed functionality on the path.
  2. Keep all Code Checker for MATLAB code on the path.
  3. Add the parts of the path specified in the input by the user to the path.
The approach listed above allows you to specify only the paths of the code that you want to check and of the local code it depends on.
Some additional remarks regarding this feature:
Adding an additional comment to the report
It’s optional for the user to add an additional comment to the report, for example the URL of the pull request that triggered the Code Checker for MATLAB run. The syntax is as follows:
>> monkeyproof.cc4m.start(..., ’comment’, ’I-Triggered-The-CodeCheckerForMATLAB-Run’);
Up Pro features