Main Content

Number of Header Files

Number of included header files

Description

Note

Use Bug Finder instead of Code Prover for computing code metrics. Support for computing code metrics in Code Prover will be removed in a future release. See Version History.

This metric measures the number of header files in the project that is considered in an analysis. Both directly and indirectly included header files are counted.

The metric gives a slightly different number than the actual number of header files that you use because Polyspace® internal header files and header files included by those files are also counted. For the same reason, the metric can vary slightly even if you do not explicitly include new header files or remove inclusion of header files from your code. For instance, the number of Polyspace® internal header files can vary if you change your analysis options.

Examples

expand all

#include<iostream>
#include<string>
// FUnction to calculate power
 long long power(double x, int n){
	 long long BN = 1;// long long
	 for(int i = 0; i<n;++i){
		 BN*=x;
	 }
	 return BN;
 }

In this example, the code does not call any of the functions defined in the iostream and string. These headers are not considered in the analysis. Polyspace® calculates this metric to be zero.

Metric Information

Group: Project
Acronym: INCLUDES
HIS Metric: No

Version History

expand all