About the default metrics thresholds configuration file
The metrics thresholds configuration file is a text file in which you set the thresholds you want Klocwork to report. If a metrics threshold is violated, Klocwork reports the violation. Each line in the configuration file sets one threshold.
For the complete list of supported metrics, see Metrics reference. Here are a few examples of the types of metrics thresholds you could set:
- Number of lines of code in a file should be less than or equal to 5000
- Complexity of a file <=20
- No more than one class defined in the file
When Klocwork reports a metric-threshold, any non-ASCII characters in the error code are replaced by "_" (underscore). However, non-ASCII characters still display (in UTF-8 encoded files) in the category name and the message. For more information, see Klocwork support for non-ASCII encoding.
The metrics thresholds configuration file, called metrics_default.mconf
, is located either in the default location, <Klocwork_install>/config
or in <projects_directory>/config
(for integration projects that have the projects_root directory in a non-default location).
All metrics rules are commented out in this default file. They must be uncommented in order to report on metric threshold violations. The metrics_default.mconf
file shows some examples of the types of threshold violation rules that can be created.