Part of the code base is not included in the SonarCloud analysis and code coverage

Template for a good new topic, formatted with Markdown:

  • Azure Devops
  • C#

Hello,
We have a project with a number of project assemblies(csproj), most of them are properly monitored by sonarCloud; we can see them for example on the main branch “Code” tab.

The issue is that only three project assemblies are not detected. we don’t see them in the “Code Tab”, and of course not any metrics. the pull request concerning these part on the code gets a green pass from sonarCloud, without any Code showing on Pull request > Code.

The code changes are perfectly showing in azure devops portal, and my understanding is that sonarCloud gets what produced by the MS build.

I don’t see any form of exlusion done on sonarCloud analysis task, the msbuild is also building properly these csproj.

Can you help figure out the reasons and how I can get them to be included in SonarCloud ?

Hi Nizar,

To better understand what the problem is, I would need some clarifications:

  • What version of the Scanner or Azure DevOps extension do you use?
  • What is the operating system?
  • Could you please share the BEGIN and END step logs in verbose mode? You can enable verbose mode by specifying /d:sonar.verbose=true when calling the Scanner, or when calling the AzureDev ops extension
- task: SonarCloudPrepare@3
    inputs:
      ...
      extraProperties: |
        sonar.verbose=true

The most common problem that prevents code from being analyzed is that the source code is placed outside of the working folder, but I would need the logs to see what the configuration is.