Customizing metrics reports in Klocwork Static Code Analysis

By default, the list of available Metrics report types in Klocwork Static Code Analysis includes:

  • Churn
  • Size
  • Complexity
You can customize the available metrics reports in Static Code Analysis by customizing the default Size and Complexity report types, adding new report types based on Klocwork metrics, and adding custom report types based on metrics you define. Once you have added new metrics report types to this list, you can also generate reports based on these types, save them, and make them public, so that all Static Code Analysis users will see them in the Reports tree.

Whenever you make changes to the metrics report configuration file (metrics.xml), you must restart the Klocwork Server by using kwservice restart or Windows Services Administration.

Migration note: When a projects_root is migrated, the Size and Complexity definitions in metrics.xml are disabled. (In new projects_roots, they are disabled by default.) If you enable either of these reports without renaming them, they show up as duplicates in the list of available report types in Static Code Analysis.