Getting error This analysis will make your organization 'XXX' to reach the maximum allowed lines

We are having error “This analysis will make your organization ‘XXX’ to reach the maximum allowed lines limit (having 321011 lines)” when running analysis on master branch.

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps)
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: C# & VB .NET
  • Error observed (wrap logs/code around with triple quotes for proper formatting)This analysis will make your organization ‘XXX’ to reach the maximum allowed lines limit (having 321011 lines)```

We have 2 .NET Solutions under Git Source Control. Below is the code metric results showing number lines of code by each project.

Total lines of code should not exceed 250k which we have on our plan. But the step “Publish Quality Gate Result” keep showing error exceeding limit with over 320k.



Hey there.

You can see all the files that are being indexed by the scanner by enabling DEBUG logging (sonar.verbose=true) and observing the Run Code Analysis logs. Are there files/languages you don’t expect to see there?

11:03:11.191 INFO: Indexing files...
11:03:11.191 INFO: Project configuration:
11:03:11.199 DEBUG: loading config FileBasedConfig[/Users/colinmueller/.config/jgit/config]
11:03:11.201 DEBUG: readpipe [/opt/homebrew/bin/git, --version],/opt/homebrew/bin
11:03:11.223 DEBUG: readpipe may return 'git version 2.43.2'
11:03:11.223 DEBUG: remaining output:

11:03:11.224 DEBUG: readpipe [/opt/homebrew/bin/git, config, --system, --show-origin, --list, -z],/opt/homebrew/bin
11:03:11.234 DEBUG: readpipe may return 'file:/opt/homebrew/etc/gitconfigcredential.helper'
11:03:11.234 DEBUG: remaining output:

11:03:11.234 DEBUG: osxkeychain
11:03:11.235 DEBUG: loading config FileBasedConfig[/opt/homebrew/etc/gitconfig]
11:03:11.235 DEBUG: loading config FileBasedConfig[/Users/colinmueller/.gitconfig]
11:03:11.255 DEBUG: 13 non excluded files in this Git repository
11:03:11.261 DEBUG: 'webinar-data/webinar-to-activity.py' indexed with language 'py'
11:03:11.266 DEBUG: 'webinar-data/README.md' indexed with no language
11:03:11.267 DEBUG: 'productboard-data/insights-to-activity.py' indexed with language 'py'
11:03:11.267 DEBUG: 'productboard-data/README.md' indexed with no language
11:03:11.268 DEBUG: 'events-data/events-to-activity.py' indexed with language 'py'
11:03:11.269 DEBUG: 'events-data/README.md' indexed with no language
11:03:11.269 DEBUG: 'README.md' indexed with no language

If you discover files you don’t expect (or don’t want) to be analyzed, you can adjust the analysis scope.

Thanks for the support. We figured it out. It caused by some css files being indexed.

1 Like