8.3.2. Additional Metrics in Trend Charts¶
8.3.2.1. Background¶
You have a running Axivion Suite CI configuration and Web UI.
You want to add the NOMV and NOMVPR metrics to the trend charts.
You want to add another metric (e.g., “Switch Complexity”) to the trend charts.
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¶
Activate rules Metric-HIS.NOMV and Metric-HIS.NOMVPR in your project configuration to calculate the metrics during the analysis run.
Enable the charts on the Trend page in
dashboard2.configas follows:
<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”)¶
Activate the metric rules you want to calculate (e.g., Metric-SwitchComplexity).
To report all values (and not just violations), set the option report_all_values of Metric-SwitchComplexity to
true(or the groupMetricsif you want to affect all metrics).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
Metricsaretrueandroot. Keep these values.Enable the charts on the Trend page in
dashboard2.configas 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¶
Set /Results/Dashboard/import_suppressed_issues to
truein the project configuration to import suppressed issues into the database.Enable the charts on the Trend page in
dashboard2.configas follows:
<Node Key="ChartDefinitions">
...
<Node Key="Style Violations">
<Binding Key="1" Value="Metric.Violations.Style"/>
<Binding Key="2" Value="Metric.Violations.Style.disabled"/>
</Node>
...
</Node>