This Software Metrics Report is part of the SafeQP Certification Kit↑, but applies to the whole QP/C Framework family↑. This document presents a comprehensive analysis of software metrics collected from the QP/C Framework.
| QP/C version | Document revision | Date (YYYY-MM-DD) | By | Description |
|---|---|---|---|---|
| 8.1.0 | A | 2025-09-01 | MMS | Created for QP/C 8.1.0. |
Software Metrics Report
Description
This Software Metrics Report, formally identified as DOC_QP_SMR, presents a comprehensive analysis of software metrics collected from the QP/C Framework by the PC-Lint-Plus static analysis tool ([PCLP-2025]), evaluated under the Hersteller Initiative Software (HIS)↑ standard and aligned with with [IEC 61508] as well as [ISO 26252] functional safety requirements. The metrics serve as quantitative indicators of code quality, structural complexity, and maintainability, critical factors in ensuring the reliability and certifiability of embedded software components. Software metrics play a pivotal role in:
Scope
By applying static analysis tools such as PC-Lint-Plus, the report assesses key attributes including cyclomatic complexity, function size, nesting depth, and interface coupling. These metrics not only support internal quality assurance but also provide traceable evidence for regulatory audits and SIL-level justification. The thresholds adopted reflect industry best practices and regulatory expectations, enabling proactive identification of architectural hotspots and guiding targeted refactoring efforts.
From the regulatory perspective, software metrics are not just engineering convenience; they are evidence artifacts that support systematic capability claims, compliance, and risk reduction across the software safety lifecycle. They flag hotspots that may introduce regression risks. The Hersteller Initiative Software (HIS) source code quality metrics ([EMENDA-HIS], [EXIDA-METRICS]) demonstrated in this QP/C Software Metrics Report provide evidence that QP/C software component meets the modularity guidelines specified in the Modular Approach Design Viewpoint, Table SDS-B9 and Table SDS-T1.
The PC-Lint-Plus v2025 ([PCLP-2025]) static analysis tool can generate a very comprehensive set of code metrics, far exceeding the HIS Standard. This section outlines how the HIS Metrics are interpreted and generated from the PCLP metrics data (see [PCLP-2025] Section 10.6 'Bult-in Metrics' and 10.6.5 'Function').
| HIS Metric | PCLP Metrics | Description (from PCLP Manual) |
|---|---|---|
| v(G) | cyclomatic_complexity | The McCabe cyclomatic complexity of a function. |
| PATH | cyclomatic_complexity * log2(halstead_vocabulary) | Where: cyclomatic_complexity is the cyclomatic complexity (v(G)) and halstead_vocabulary is the Halstead vocabulary (N), both measured by PCLP. |
| STMT | num_stmts | The number of statements within a function. Every statement within the body of any compound statement is counted. |
| LEVEL | avg_scope_nesting_depth | The average nesting depth of compound statements enclosing each statement in a function. That is, the sum for each integral nesting level of the product of that nesting level and the number of statements with that nesting level, divided by the number of statements. |
| CALLS | num_called_functions | The number of distinct functions defined within the analyzed project called by this function. Each function called at least once is only counted once, regardless of how many different calls to it appear within the body of this function. This metric does not count called functions that exist only as declarations that are never defined anywhere within the analyzed project. |
| PARAM | num_parameters | The number of parameters for a function. In C, the explicit me instance parameter is counted, but in C++ the implicit this instance parameter is not counted. Also, in C++, parameters with default arguments are counted. |
| RETURN | num_return_stmts | The number of return statements within a function. The implicit return at the end of main or a function defined as returning void (or a catch clause of a function-try-block thereof) is not included. |
| GOTO | num_backward_goto_stmts + num_forward_goto_stmts | Calculated sum of: The number of backward goto statements plus the number of forward goto statements within a function. |
| COMF | num_comment_lines / num_code_lines | Calculated ratio of: The number of comment lines to the number of code lines in a lexical function definition. |
| NOMV | see misra-qp | The number of HIS subset violations after applying the provided Deviation Permits and Deviation Records. |
| NOMVPR | see misra-qp | The number of MISRA violations per rule after applying the provided Deviation Permits and Deviation Records. |
| [IEC 61508-3:2010] | IEC 61508-3:2010 Functional safety of electrical/electronic/programmable electronic safety-related systems- Part 3: Software requirements |
| [IEC 61508-4:2010] | IEC 61508-4:2010 Functional safety of electrical/electronic/programmable electronic safety-related systems- Part 4: Definitions and abbreviations |
| [ISO 26262-6:2018] | ISO 26262-6:2018(en) Road vehicles - Functional safety - Part 6: Product development at the software level. International Standardization Organization. |
| [ISO 26262-8:2018] | ISO 26262-8:2018(en) Road vehicles - Functional safety - Part 8: Supporting processes. International Standardization Organization. |
| [IEC 60300-3-1:2003] | IEC 60300-3-1:2003: Dependability management - Part 3-1: Application guide - Analysis techniques for dependability - Guide on methodology. International Standardization Organization. |
| [EMENDA-HIS] | Hersteller Initiative Software (HIS), https://emenda.com/his |
| [EXIDA-METRICS] | Software Metrics, https://www.exida.com/blog/software-metrics-iso-26262-iec-61508 |
| [PCLP-2025] | Reference Manual for PC-lint Plus Version 2025, A diagnostic facility for C and C++, Vector Informatik↑ |
| [DOC_MISRA_QP] | misra-qp |