My projects project summary displays message "The main branch of this project is empty."

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps)
  • Languages used: C#, typescript
  • message “The main branch of this project is empty.” is displayed instead of the 6 ratings available (Security, Reliability, Maintainability…)
  • Go to the My projects page

Our project manager has noticed that the ratings for half of our projects have been replaced with the message “The main branch of this project is empty.” he wants them back. We did have them, but I was unable to work out when they disappeared. We have other projects that don’t appear to be affected as they still show these ratings.

I have tried to run the builds for the master branch and a PR build for the projects in question but the message remains unchanged. I have had a change request for one of the projects, Everything went through the process and that didn’t update that project display.

I have looked at some of the other threads that reference this message, but they all seem a little different from what we are experiencing.

Hi,

Do you have any analysis warnings on these projects? What shows up in the Administration → Background Tasks for these projects? Were all analysis reports processed successfully?

 
Ann

Hi,

I found this warning, for the last build we have done.

The last time this project was built that completed without warning was 24th October 2024. The next time it runs/builds is 13th November, Not sure why it was triggered for build yet (I am still trying to find changes for this project between these dates) but this is when we start getting the warning.If that helps any…

Hi,

That warning is very helpful.

In fact, the “empty” message you’re seeing is based not on the project being entirely empty, but on the presence/absence of a sentinel metric: lines of code.

Here’s how we determine what’s a test & what’s code.

 
HTH,
Ann

Hi,

I have gone through that info page, I added:
SonarQubeTestProject>false</SonarQubeTestProject>

to the main project file. The warning is still present.

Is there anything else that could be the problem?

Hi,

Would you care to share a full, sonar.verbose=true log?

 
Ann

Hi,

I have attached the log
SiteSurvey-Sonar-log.log (5.4 MB)

I have had a quick look at the log, I have noticed that it is saying that files that are definitely part of the app are test files. “App_Start/BundleConfig.cs” is not a test file. I don’t understand a lot of it, I hope it helps.

The primary project name is SiteSurvey which is the Web Application.

Hi,

Thanks for the log files.

What changed between these two dates? Was it perhaps analysis configuration?

A search of the log shows 31 hits for “baseDir”, which is… a lot. Are you setting this explicitly in your project files? Because there are a whole lot of lines like this:

2025-02-20T09:27:54.6160755Z 09:27:54.574 WARNING: File 'D:\a\1\s\Common\Aes.Services\BaseEntityService.cs' is not located under the base directory 'D:\a\1\s\Apps\SiteSurvey\Main' and will not be analyzed.

Which is not normal.

 
Ann