Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NLOC and Complexity numbers during Code Analysis

Tags:

c++14

I wrote a code for constructing an expression tree and traversing the tree in three different ways
a) Inorder traversal
b) Postorder Traversal
c) Level order Traversal

So, I wanted to know the complexity of my code and found this website which calculates it:
[ http://www.lizard.ws/ ]

These were the results:

Function Name       NLOC      Complexity     Token #    Parameter #  

faw                  10         6             51    
push                 12         2             61    
pushp                12         2             61    
pop                   5         1             25    
popp                  5         1             25    
inorder               9         2             38    
postorder             9         2             38    
printLevelOrder       7         2             40    
printLevel           12         4             66    
height               15         3             76    
main                 100        21           738

Question: What does NLOC and the numbers for complexity denote? Does having a high number mean, the code isn't well optimized?

like image 766
Varun Shaandhesh Avatar asked Jul 25 '26 13:07

Varun Shaandhesh


1 Answers

NLOC Denotes number of lines of code.For example here against push function the value is 12,NLOC tell us the size of function.Complexity column denotes the complexity of each function code.