SonarCloud Analysis not scanning code in Repository


I have recently tried to integrate Sonar Cloud into my company’s repos, starting with one, and I thought I did everything right, but the analysis is coming with 0s for everything, and we know we are not that good. I do not think that the sonar cloud is scanning through the code.

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used when applicable: MSBuild
  • Languages of the repository: C#

When I also try to look at the analysis in Sonar Cloud, before clicking on the project they say the main branch of my project is empty, even though it is not.

Thanks in advance,

Hey there.

Does the analysis complete successfully (based on the logs in your pipeline)? Any warnings? What do you see in the Code tab of your project?

Hey, I had a PR request that needed to get merged that involved adding code coverage and that was able to fix the problem. Thank you!

1 Like

Hey, one quick question I am getting 0.0% coverage when sonar cloud does an analysis which means nothing is covered by tests. This analysis is run on a dotnet project besides adding the below code was there something else I was supposed to add?

- task: DotNetCoreCLI@2
            command: 'test'
            arguments: '--collect "Code Coverage"'


What do the logs say?