HIS Metrics is one of Understand's built-in reports — run it on your own code from the GUI, or headlessly with und report.
HIS Metrics
Languages: AnyTargets: Architectures, Files, Functions, Project
Display the Hersteller Software Initiative metrics for functions
When run on a function, display the HIS metrics for that function. When run on a file, architecture, or project, show a table with the HIS metrics as columns and a row for each function.
See https://emenda.com/his/ ↗ for HIS Metrics. There is also a blog article ↗. This report includes the following metrics:
HIS Metrics - Understand Metric
- Comment Density (COMF) - RatioCommentsWithBeforeToCode
- Number of Paths (PATH) - CountPath
- Number of Goto Statements (GOTO) - CountGoTo
- Cyclomatic Complexity (v(G)) - cyclomatic variant controlled with option
- Number of Calling Functions (CALLING) - CountCallbyUnique
- Number of Called Functions (CALLS) - CountCallsUnique
- Number of Function Parameters (PARAM) - CountParams
- Number of Instructions (STMT) - CountStmt
- Number of Call Levels (LEVEL) - MaxCallDepth -1 if cycles/recursion.
WARNING: Expanding call trees can take a long time - Number of Return points (RETURN) - CountEarlyExit only counts early returns, so expected is 0
- Language Scope (VOCF) - LanguageScope
- MISRA HIS Subset Violations (NOMV) - HISNOMV
REQUIREMENT: "MISRA HIS Subset" configuration must be running in the background - Number of recursions (AP_CG_CYCLE) - IsRecursive 0 if function is not recursive, 1 if it is directly recursive, 2 if it is indirectly recursive.
WARNING: Expanding call trees can take a long time
If a comparison database has been set, then the following additional metrics are included. Note that the reported metrics are all line based, not statement based.
- Statements Changed (SCHG) - CountLineChanged
REQUIREMENT: Comparison database must be set - Statements Deleted (SDEL) - CountLineRemoved
REQUIREMENT: Comparison database must be set - New Statements (SNEW) - CountLineNew
REQUIREMENT: Comparison database must be set - Stability Index (S) - StabilityIndex
REQUIREMENT: Comparison database must be set
See also the Hersteller Initiative Software (HIS) solution.