Too many lines; how?

I am trying to submit the analysis of one of our projects to SonarCloud, but it is rejected because there are apparently too many lines of code. reports that the project has 1360533 lines of code, but a manual count reveals more like 100k lines of code, so there might be something wrong with our configuration. Is there any way to get more details so that we can figure out what’s wrong here?

Welcome to the community!

The computation of the lines of code is defined on the Metric Definitions page of the documentation (search for “Lines of code”).

The logic documented here is applied to your source and test files, which is controlled by sonar.sources, and related parameters (See Narrowing the Focus).

If the count doesn’t match what you expect, I suggest to look at the output of the scanner with debug mode enabled. There you should see which files were actually analyzed. Maybe there are more files analyzed then you expected. Alternatively, you could perhaps find the directory that contributes unexpectedly high number of lines by adjusting the sonar.sources and related parameters.