How to re-trigger main branch analysis after upgrading for more lines of code

After configuring a repo with SonarCloud, the initial analysis of our master branch failed due to it having too many lines of code for our paid level (100k for 11 euro / month). After we upgraded to the next level (250k for 80 euro / month, which allows for more lines of code than our repo contains), the main branch analysis still shows the error messages below. We have merged in a pull request to master after upgrading our account and the errors remain. Is there a way to re-trigger an initial analysis of our main (master) branch?

  • ALM used = Github
  • Languages of the repository = Ruby, JS
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting) = see below
"master" branch has not been analyzed yet and you have multiple branches already. It looks like it is not your Main Branch, check your configuration.


Last analysis failed
Analysis ID "{id here}"
Your analysis with ID "{id here}" has failed: your number of lines exceeds your organization plan.


Welcome to the community!

Are you using automatic analysis, or are you analyzing in your own CI?


Hi! We’re using automatic analysis.


Okay, to verify, after you upgraded your plan, you made changes to your master branch, but no new automatic analysis has run. And other branches have been picked up and analyzed by automatic analysis. Right?

Just to make sure, can you check your project’s Background Tasks and make sure nothing shows up there?


P.S. Do you see a “Force automatic analysis” button?

You are correct. All new PRs on Github are being analyzed by SonarCloud as expected, but even after merging to master, the ‘Main Branch’ screen continues to show the errors shown below (note that this modal error message appears after I click the The last analysis has failed.See details link in the upper right of the ‘Main Branch’ tab):

I do not see a ‘Force automatic analysis’ button.


Since analysis is running on other PRs and branches, I don’t think any of the “turn on automatic analysis” advice in the docs is going to help. :sweat_smile:

It looks like this got “hung” somehow. I’m going to call for help.

But in the meantime, are you comfortable sharing publicly your organization and project (and/or URL)?


Hi, sure. Organization is ‘inKind’ and the project is ‘web’.

1 Like

Hi Ann,

Just following up on this - thanks!


Sorry about the delay. We’re shuffling things around internally, but hopefully someone will be along soon.


1 Like

Greetings Andrew,
Sorry for the long delay, I’ve had a chance to look into your project and I see that there have been scans as recent as today that have succeeded for this project. Would you mind confirming?

Thank you,

Hi Lucas, yes, there are scans for each new pull request. The issue remains that a full analysis still has not run on our entire master branch, as shown here here.

The lack of main branch analysis means that I am not able to access the settings for the main branch, etc, which is blocking us from fully using the product.


Alright I’ve dug a little deeper into what’s going on, The reason you’re still seeing this error is that the master branch analysis still has too many LOC being analyzed

This analysis will make your organization 'inkind' to reach the maximum allowed lines limit (having 358054 lines)

we are detecting 358054 lines of code while the plan you are currently on is 250000. If you think this is too large, perhaps there is a temporary directory that is being analyzed that shouldn’t be.
Here is a link to the documentation as to how we calculate LOC

I hope this helps give some clarity to the issue.

More about the report processing at

Thanks Lucas. Can you tell me which branch is the largest (i.e. the one with the 358054 LOC)?

I can gather the information below if it is helpful (from a more recent scan)

INFO: More about the report processing at

Pull request: 2696

Hi Lucas, I’m getting the error shown below when I click that link:
Screenshot 2024-03-04 at 9.48.15 AM

Can you clarify which branch has the largest LOC? I’m wondering specifically if there is only one branch above the 250000 limit or if there are several branches over the limit?

Can you clarify which branch has the largest LOC? I’m wondering specifically if there is only one branch above the 250000 limit or if there are several branches over the limit?

Referring back to the docs, as long as your main branch is not empty, we will evaluate it to determine the LOC count. If you have more projects being evaluated, the main branch LOC from other projects will add up to your quota.

So it doesn’t matter the size of the branches, just the size of your main branch.

EDIT: Apologies, I misspoke above. The largest branch determines the LOC for the project. But from what I can see, for your project, the analysis that triggers the “number of lines exceeds your organization plan” error is from the master branch