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 the 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 must 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 to calculate the metrics during the 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 (e.g., Metric-SwitchComplexity).

  2. To report all values (and not just violations), set the option report_all_values of Metric-SwitchComplexity to true (or the group Metrics if you want to affect all metrics).

  3. To display metrics on the Trend page, they must first be propagated to the system level. By default, the options propagate and report_propagated_values of Metric-SwitchComplexity and of the group Metrics are true and root. Keep these values.

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

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

Note

You can also visualize average (.avg), maximum (.max), and minimum (.min) values for metrics. These should be placed in separate charts, as the scales of such summary metrics do not match the scale of the sum of a metric. Configuration changes take effect immediately in the dashboard.

Suppressed Issues

  1. Set /Results/Dashboard/import_suppressed_issues to true in the project configuration to 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>