8.3.2. Additional Metrics in Trend Charts

8.3.2.1. Background

  • You have a running Axivion Suite CI configuration and Web UI.

  1. You want to add NOMV and NOMVPR metrics to the Trend charts.

  2. You want to add another metric (e.g. “Switch Complexity”) to the Trend charts.

  3. You want to add the number of suppressed issues to the Trend charts.

8.3.2.2. What can be configured?

You have to configure the project configuration to create the metrics and the dashboard configuration to display them.

8.3.2.3. What needs to be done?

NOMV/NOMVPR

  1. Activate rules Metric-HIS.NOMV and Metric-HIS.NOMVPR in your project configuration in order to calculate the metrics during analysis run.

  2. Enable the charts on the Trend Page in dashboard2.config as follows:

Dashboard trend chart definitions.
<Node Key="ChartDefinitions">
  ...
    <Node Key="Number of Misra Violations">
      <Binding Key="1" Value="Metric.HIS.NOMV"/>
    </Node>
    <Node Key="Number of Misra Violations per Rule">
      <Binding Key="1" Value="Metric.HIS.NOMVPR.MisraC2012-1.1"/>
      <Binding Key="2" Value="Metric.HIS.NOMVPR.MisraC2012-15.5"/>
      <Binding Key="3" Value="Metric.HIS.NOMVPR.MisraC2012-17.4"/>
      ...
    </Node>
  ...
</Node>

Other metrics (e.g. “Switch Complexity”)

  1. Activate the metric rules you want to calculate (in this example Metric-SwitchComplexity).

  2. If you want to report all values (and not just violations), you can set Metric-SwitchComplexity/report_all_values to true (or more globally Metrics/report_all_values to true if you want to affect all metrics).

  3. In order to display metrics in Trend Page they need to get propagated to the system level first. Therefore you have to set Metric-SwitchComplexity/propagate to true and Metric-SwitchComplexity/report_propagated_values to root (if you want this effect for all metrics, you can similarly set Metrics/propagate to true and Metrics/report_propagated_values to root).

  4. Enable the charts on the Trend Page in dashboard2.config as follows:

dashboard2.config: Dashboard setup.
  <Node Key="ChartDefinitions">
    ...
    <Node Key="Complexity">
      <Binding Key="2" Value="Metric.McCabe_Complexity.sum"/>
    </Node>
    ...
  </Node>

Note

It is also possible to visualize Average (.avg), Maximum (.max), and Minimum (.min) values for metrics. This should be done in separate charts, though, because the scales of such summary metrics do not match the scale of the sum of a metric. Changes to the configuration have immediate effect in the dashboard.

Suppressed Issues

  1. Set /Results/Database/import_suppressed_issues to true in the project configuration in order to also import suppressed issues into the database.

  2. Enable the charts on the Trend Page in dashboard2.config as follows:

Suppression statistics.
<Node Key="ChartDefinitions">
  ...
    <Node Key="Style Violations">
      <Binding Key="1" Value="Metric.Violations.Style"/>
      <Binding Key="2" Value="Metric.Violations.Style.disabled"/>
    </Node>
  ...
</Node>