Exceeding lines of code limit error when the source being scanned is less than the limit

Hi,

We are scanning a C++ project, have narrowed the source folder, and excluded all file types except C++ type files. When the scanner runs on the project, using the Sonar wrapper it fails the analysis saying that it has exceeded the 1 million line of code limit. The source being scanned is approximately a quarter of that size and the total project is only about 700k lines of code. Is there documentation I am missing that explains what is counted in the scan for lines of code? I am aware of the definition of lines vs lines of code https://docs.sonarqube.org/latest/user-guide/metric-definitions/#MetricDefinitions-Size . Shouldn’t the provided source be the only thing scanned, are excluded files counted in the lines even though they aren’t being scanned? Any insight that can be provided as to where this count is coming from would be appreciated. Also is there an output somewhere that tells me how many lines are scanned specifically?

Thanks in advance!

Tommy

Hi @Tommy_Haggerty,

you may want to start easy the other way around, and instead of excluding start including only what you care, as an example:

sonar.sources=src
sonar.inclusions=**/*.cpp,**/*.h

Hi @mpaladin

Thanks! That worked great! I guess a lot more was getting counted aside from the ones I excluded initially.

Tommy

Hi @Tommy_Haggerty,

great, from this point you can see what else to include if you have other files which are not C/C++ and you want them on SonarQube.