Our scans are failing with an LOC-limit error

Our scans are failing with an LOC-limit error. The current plan allows 100K LOC but this project is ~53K Locs.

Please advise why we’re blocked and how to resolve.

Typically this happens because more files are being indexed than you expect. 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