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: