4.9.1. HIS Compliance Checking Guide

4.9.1.1. Checking HIS compliance with Axivion Suite

The Axivion Suite can be used to check code compliance with HIS metrics. Simply select the desired metrics in the rule group 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 Metric-HIS.NOMV and Metric-HIS.NOMVPR.

The HIS metrics supported by Axivion Suite are listed in the following summary table:

Supported HIS metrics

Additionally, MISRA violations are reported in detail among style-check violations, and call graph cycles can be inspected under Cycles in the dashboard.

Configuration

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

The following example enables all HIS metrics in a Python layer. It is also possible to enable them individually.

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

To compute violations against the HIS metrics, you can set the allowed ranges as shown in the following example. If you do not set the ranges or only 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, use commentary activators (see Justifications and Suppressions with Code Annotations).