Main Content

Number of Lines

Total number of lines in a file

Description

This metric calculates the number of lines in a file. When calculating the value of this metric, Polyspace® includes comments and blank lines.

This metric is calculated for source files and header files in the same folders as source files. If you want:

Examples

expand all

// 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;
 }
//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))));
 }

Because Polyspace includes comments and blank lines when calculating this metric, the total number of line in this file is 18.

Metric Information

Group: File
Acronym: TOTAL_LINES
HIS Metric: No