Utilized LOC in SonarCloud


We have purchased the SonarCloud license initially for 100K lines. Currently we have utilized ~52K LOCs. We trigger our scans via Jenkins. We would like to implement the below to make sure that we do not cross the available LOC limit during the scan.

In short - requirement is

  1. New project/branch is added
  2. If the available LOC’s is less then a pre-defined threshold - say 10K - then an alert should be sent to the owner - and the scan should be aborted.

We can also set a nightly job - where if the available LOC’s is less then set threshold - automatic alert should be triggered.


Hi Rohan,

These requirements are natively in place in SonarCloud:

  • a new analysis reaching the LOCs of your plan will fail with this message:

This analysis will make your organization ‘your-organization-name’ to reach the maximum allowed lines limit.
Please contact the administrator of the organization to resolve this issue.

  • when you reach 90% of your plan, an email is automatically send