NSLOC stands for 'Normalized Source Code', which is a custom measurement we use (among others) when evaluating the complexity of a codebase.
To get the NSLOC count of a file:
- For all functions, reduce any multiline function declarations to a single line.
- Remove all comments
- Remove all empty lines
- Count the remaining lines
Example:
function foo(
uint a,
bytes32 b,
address c
)
would be replaced with:
function foo(uint a, bytes32 b, address c)
We do this because listing arguments on multiple lines actually increases readability, and does not increase complexity.