Billing and Monthly Line of Code

We chose the 5 million lines of code plan and used it all up in the first month. For the second month, will we receive another 5 million lines of code for scanning, or will there be an additional charge for that?

The limit is not time based. This is the total number of unique lines of code your repositories can have in their main branch.

So for example if you have 4 repositories with each 1M lines of code you can scan then as many times as you want with the 5M limit.

If you add an other repository with an other 1M lines of code then your limit will be used up.

The line of code count calculation is actually more complicated than what I wrote above but this is a general rule of thumbs you can apply. If you have loads of branches, with different lines of code, then the different ones will likely increase you totals.

So bottom line, it seems that you do have 5M+ lines in your repositories and you will need to either reduce the number of lines analysed or go to the next tier.

See if you have old repositories you no longer need to scan and remove them from Sonar. That will free up lines from the limit. If you have ‘generated’ code, for example mocks for unittests, you might want to exclude these from Sonar Analysis. That will free up some lines as well.

It also depends on how you manage and analyze your repositories. For example if you have multiple forks of your repositories and you run Sonar on the different forks, then Sonar will consider that unique new lines and it will hit your line count limit. To help with that I would recommend that you only analyze your main repository and not the forks.

2 Likes