“The main branch of this project is empty.” is coming in Sonarcloud dashboard for my project

ALM used: GitHub
CI system used: Github Actions
Languages of the repository: Java

Analysis Method: SonarCloud’s CI-based analysis

“The message ‘The main branch of this project is empty.’ is appearing on the SonarCloud dashboard for my project. It was working before this, but I can see that a new analysis has passed in the latest activities. How can we fix this issue?”

Hi,

Are you saying this exact project previously had content for the main branch and then it disappeared and was replaced by this message?

Or are you saying that other projects have content and one new project has this message?

 
Thx,
Ann

Yes, it previously had content for the main branch, and now it also has content, but this message appeared.We didn’t change anything. It was working before this.

Hi,

Could we have a screenshot of that, redacted as necessary?

 
Thx,
Ann



Hi,

Thanks for the screenshots. The one showing that ‘dev’ is your main branch, and has passed the QG is especially helpful.

Since you say this used to work, I’m guessing we introduced a UI bug, and have flagged this for the team. Do you know when, approximately, this stopped working?

 
Thx,
Ann

Hi again,

If you click through on dev, is it in fact empty? As in 0 lines of code?

 
Thx,
Ann

I couldn’t tell when it stopped working, but we detected this issue/comment yesterday (24.06.2024).

Also, when I click on it (see in screenshot), it redirects me to the our GitHub commit page, which is not empty. It shows the changes that were made.

Hi,

And when you click on dev in that list?

 
Ann

When i clicked on dev it redirected me to this page in screenshot

Yes 0 lines of code

Hi,

Then this isn’t about the UI, this is about your analysis. Something changed in your pipeline so that when analysis runs, it’s not finding any code.

Do you still have your logs? Can you trace back to compare the difference in your pipeline logs before and after this change?

 
Ann

Now it fixed, but I didn’t do anything.Also it shows 42k lines of code

here is screenshots


Hi,

This is definitely something going on in your pipeline causing the number of lines of code in the analysis to fluctuate.

It would be worth comparing a 0-LOC job log to the latest.

 
HTH,
Ann

We will check . Thank you for your support.