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.
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?
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):
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?
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 https://sonarcloud.io/api/ce/task?id=AY3Xy9rAo0YjOQP1krrE
Hi Lucas, Iâm getting the error shown below when I click that link:
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