Main Content

Number of Files

Number of source 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 calculates the number of source files in your project.

Examples

expand all

#include<iostream>
#include"pow.cpp"

double power(double, double);
//Function to calculate approximate index 
 double AppxIndex(double m, double f){
	 double U = (power(m,2) - 1)/(power(m,2)+2); //First term
	 double V = (power(m,4) + 27*power(m,2)+38)/
	 (2*power(m,2)+3);// Second term
	 return (1+2*f*power(U,2)*(1+power(m,2)*U*V +
	  power(m,3)/power(m,3)*(U-V)))
	 /( (1-2*f*power(U,2)*(1+power(m,2)*U*V 
	 + power(m,3)/power(m,3)*(U-V))));
 }

 
 int main(){
	 return 0;
 }

In this example, the code calls the function power, which is defined in an included source file pow.cpp. When analysing the code, Polyspace® does not consider the included source file. Because the included source file is not considered in the analysis, Polyspace evaluates the number of source file to be one.

Metric Information

Group: Project
Acronym: FILES
HIS Metric: No

Version History

expand all