Metrics

There are a number of metrics that can be run by CC4M. These are explained in the following sections. When selecting the option Include metrics in the GUI, the full results of all metrics are shown. If this option is not selected, only the violations and errors encountered by the metrics are reported. For every metric, an exemption tag is given. For more information about this, see section Exemptions.

Meta data and summary

Under meta data, the following things are listed:

  • The time the check has finished.
  • The user that initiated the Code Checker.
  • A user comment that the user added to the report's content (if any), for example the pull request URL related to the run.
  • The selected job type/settings.
  • Environment information such as the CC4M version, MATLAB release, and platform.
  • The root folder of the selection. This can take on one of three shapes:
    • The full path of a file when a single file was selected.
    • The present working directory.
    • A selected folder.
  • The file(s) checked. If only one file was selected, this displays the name of the file. If more files were selected, this will show the number of checked files.
  • The number of files that could not be checked due to an error in the file (if any).
  • The number of failing checks (if any), sorted by priority.
  • The configuration file that was used to obtain the settings for each check. It includes a link to open the file.
  • The number of enabled checks and reports after applying priority filtering.
  • The number of disabled checks and reports and a link to an overview of the disabled checks/reports. This is not shown if there are no disabled checks.
  • Number of configuration problems:
    • Checks that have not been configured.
    • Check parameters that have not been configured.
    • Check parameters that have been configured more than once.
  • The reports folder in which CC4M reports and the installed toolbox information are stored.

The summary shows which checks have failed for at least one of the checked files. In case the Include passed checks option, see section Report, is enabled the summary contains information on all checks ran, which might include passed checks as well. The summary provides the following things:

  • Name of the report or check that failed.
  • Link to the results of that report/check. Click the name of the report/check to follow the link.
  • Status of the report/check per checked file. Since multiple files can be checked for the same rules, there can be more than one status per report/check.
  • Relative path to the checked file(s) that failed the check. Again, multiple paths per report/check can be reported.

If a file contains a parse error or invalid characters, CC4M cannot check it. The summary will include a list of all the checked files that contain a parse error or invalid character. The files can be clicked which will open the file in the MATLAB editor so that you can easily target the errors. These errors will also be reported by checkCodeInterpretable, see section checkCodeInterpretable.

Configuring reports folder

By default, any reports are stored as .html files in the default folder that contains the reports. For Windows this is:

%APPDATA%\Roaming\cc4m\cc4m_reports

For Mac this is:

~/Library/Application Support/cc4m/cc4m_reports

For Linux this is:

~/.matlab/cc4m/cc4m_reports

This folder can be changed by using the Report tab in the GUI. If you enter a reports folder that does not exist, CC4M will create it and activate it. From then on, the selected folder will be used to store CC4M reports and a list of installed toolboxes. If you select an invalid folder name (for example with invalid characters in it), CC4M reports will be stored in the folder you had enabled before. Changing the reports folder can also be done from the command window using:

monkeyproof.cc4m.setReportsFolder('C:\Software\CC4M\Reports');