False LOC limit error on new project in Team Plan

Hello SonarCloud Team / Community,

We are experiencing a false “maximum lines” error on a new project in our organization:

Plan: Team Plan
Actual LOC: ~51,000
Total LOC in org (dashboard): 0

This analysis will make your organization ‘####’ reach the maximum allowed lines limit (having 188880 lines).

Hey there.

I’m not sure what you mean by this, can you share a screenshot?

That’s all fine, but I think you should come back to what I mentioned in my last response.

You can see exactly what files are being indexed by the scanner by turning on DEBUG level logging (sonar-scanner -X or setting sonar.verbose=true). Things to watch out for are things like third-party packages/libraries that should be excluded.

In the logs, you’ll see lines like this:

15:05:47.351 INFO: Indexing files...
15:05:47.351 INFO: Project configuration:
15:05:47.352 INFO:   Excluded sources: **/build-wrapper-dump.json, **/*.test.js
15:05:47.352 INFO:   Included tests: **/*.test.js
15:05:47.356 DEBUG: 'jest.config.js' generated metadata with charset 'UTF-8'
15:05:47.356 DEBUG: Average line length for jest.config.js is 21
15:05:47.358 DEBUG: 'jest.config.js' indexed with language 'js'
15:05:47.359 DEBUG: 'app2/calculator.js' generated metadata with charset 'UTF-8'
15:05:47.359 DEBUG: Average line length for app2/calculator.js is 18
15:05:47.360 DEBUG: 'app2/calculator.js' indexed with language 'js'
15:05:47.360 DEBUG: 'README.md' indexed with language 'null'
15:05:47.360 DEBUG: 'sonar-project.properties' indexed with language 'null'
15:05:47.361 DEBUG: 'package-lock.json' indexed with language 'json'
15:05:47.361 DEBUG: 'package.json' indexed with language 'json'
15:05:47.361 INFO: 6 files indexed

If you find such files, you can exclude files from analysis.