I’m working on getting multiple of our projects analyzed with SonarCloud. So far so good, but I’m about to hit 500k lines of code covered. So I started to look into this in a bit more detail and I have some questions on what lines of code are counted for the billing.
When I use the SonarCloud portal UI to navigate through the files I was under the impression that every using statement, white line, and comment were also counted in the total amount of LoC.
The “Lines” box you highlighted represents the number of lines of the file : this is not the number of LoCs of that file.
Number of Lines of Codes for files is visible one level above, when you see the list of files, example :
The sample I included in the screenshot shows 15 one level up. So only whitespaces are not counted in this case. Also I’ve looked at some other files and comments are not counted either.
I do see that all the usings and {} are counted, so that adds up pretty fast.
Lines of code ( ncloc ) Number of physical lines that contain at least one character which is neither a whitespace nor a tabulation nor part of a comment.