4.6.1. HIS Compliance Checking Guide

4.6.1.1. Checking HIS compliance with Axivion Suite

The Axivion Suite can be used to check your code for compliance with HIS metrics. Simply select the desired ones in the rulegroup HISMetrics in the GUI.

To compute the number of MISRA violations as a metric, activate the desired MISRA checks (see MISRA® Compliance Checking Guide) and configure the rules HIS-NOMV and code:HIS-NOMVPR.

The HIS metrics supported by the Axivion Suite are listed in the following table which summarizes all supported metrics:

Supported HIS metrics

In addition, MISRA violations are reported in detail among stylecheck violations, and callgraph cycles can be inspected in detail under Cycles in the dashboard.

Configuration

Enable the HIS metrics in the graphical user interface axivion_config or inside a Python configuration file.

The following example will enable all HIS metrics in a Python layer. It is also possible to enable them per metric.

import axivion.config
analysis = axivion.config.get_analysis()
analysis.activate('HISMetrics')

To compute violations against the HIS metrics, you can set the allowed ranges like in the following example. If you do not set the rangs or just one threshold, default values are used for the missing thresholds.

analysis['Metric-HIS.CALLING'].min_value = 0
analysis['Metric-HIS.CALLING'].max_value = 5

analysis['Metric-HIS.CALLS'].min_value = 0
analysis['Metric-HIS.CALLS'].max_value = 7

analysis['Metric-HIS.COMF'].min_value = 0.2
analysis['Metric-HIS.COMF'].max_value = None

analysis['Metric-HIS.GOTO'].min_value = None
analysis['Metric-HIS.GOTO'].max_value = 0

analysis['Metric-HIS.LEVEL'].min_value = 0
analysis['Metric-HIS.LEVEL'].max_value = 4

analysis['Metric-HIS.PARAM'].min_value = 0
analysis['Metric-HIS.PARAM'].max_value = 5

analysis['Metric-HIS.PATH'].min_value = 1
analysis['Metric-HIS.PATH'].max_value = 80

analysis['Metric-HIS.RETURN'].min_value = 0
analysis['Metric-HIS.RETURN'].max_value = 1

analysis['Metric-HIS.STMT'].min_value = 1
analysis['Metric-HIS.STMT'].max_value = 50

analysis['Metric-HIS.VG'].min_value = 1
analysis['Metric-HIS.VG'].max_value = 10

analysis['Metric-HIS.VOCF'].min_value = 1
analysis['Metric-HIS.VOCF'].max_value = 4

To mark intentional (or accepted) violations of HIS metrics, you can use commentary activators (see Justifications and Suppressions with Code Annotations).