SonarCloud Lines of Code and Code Coverage Not Analysing

We have a few code repositories where some of the analysed projects do not have a ‘Lines of code’, ‘Coverage’ or ‘Duplications’ score, see the screenshot below:

We can’t understand why these particular projects in a solution are missing these key analysis scores in the UI.

Key Information:

  • This is a .NET 6 application deployed to Kubernetes.
  • We use Azure DevOps for code repository and pipeline files for pushing to SonarCloud.
  • Coding language is C# and pipeline files are yml.
  • The overall ‘Lines of Code’ analysis adds up to 1.9k in the example screenshot above.

Please note that we have tried the following:

  • Deleting the project from SonarCloud and recreating again via a fresh pipeline push.
  • We have other code repositories that use exactly the same pipeline code in Azure DevOps to generate the project in SonarCloud and push the analysis results to SonarCloud UI, where all projects in the solution have analysis results.

How can we make sure all projects in the solution have no missing analysis scores?

Thank you :slight_smile:

1 Like

Hey there.

These symptoms can indicate that some projects are being indexed as test projects.

I suggest looking at this documentation to understand if that’s the case, and if so how to make sure those projects get indexed as product code.

Hi Colin,

Thank you for the reply and link to the related documentation.

We had an internal NuGet package installed in those particular projects which included a reference to ‘Moq’ package (a type of test package), which when removed meant the analysis results started to appear again.

Very happy - thanks once again!

4 Likes