'Task failed with status FAILED, Error message: This analysis will make your organization ‘’ to reach the maximum allowed lines limit (having 773759 lines).
I have tried all the sonarcloud suggested for the same error for other people and initially it worked. but after couple of runs, it is again throwing the same error and even in other projects in the same organization.
It is a CI-Based analysis and Node js project. Organization is licensed for 1 Million lines. Though there aren’t those many lines of code, it is showing it is exceeded the maximum lines of code.
Please help on how exactly this is working and how to fix this issue. Thanks.
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
What is particularly impactful is to look for differences between what files are being indexed on a run that produces a successful analysis compared to a failed analysis. Are different files being indexed?