Sonar metrics issue

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

Hi Team,

One of our user is facing an issue with metrics.

For one of there project they were able to see the all the metrics in ( SIZE, Coverage )but for other project in same version they were not able to see them . May I know why they are facing this issue.
Attaching the screenshots of both projects metrics.

We are using * Developer Edition

  • Version 8.9.6

Hi,

Do these two projects use different languages? Analysis provides extra metrics for some languages, and I think that’s what you’re looking at here.

 
Ann

Hi Ann,

Thank you for the reply !

Actually, user is using same language C# for both the projects.

Hi,

Thanks for getting back to me. I’ve flagged this for the attention of the language experts.

 
Ann

Hi,

Any update on this please.

hello @Vinodchandra

how are you integrating your build with SonarQube? could you share with us your setup and commands you are using to run the analysis?

could you please share verbose msbuild and Scanner for .NET logs?

Share the Scanner for .NET verbose logs

  • Add /d:"sonar.verbose=true" to the…
    • SonarScanner.MSBuild.exe or dotnet sonarscanner begin command to get more detailed logs
      • For example: SonarScanner.MSBuild.exe begin /k:"MyProject" /d:"sonar.verbose=true"
    • “SonarQubePrepare” or “SonarCloudPrepare” task’s extraProperties argument if you are using Azure DevOps
      • For example:
        # Applies to SonarQubePrepare as well
        - task: SonarCloudPrepare@1
            inputs:
              SonarCloud: 'sonarcloud'
              organization: 'zucchinibreadco'
              scannerMode: 'MSBuild'
              projectKey: 'zuchhinibreadco_sonar-scanning-someconsoleapp'
              projectName: 'sonar-scanning-someconsoleapp'
              extraProperties: |
                sonar.verbose=true
        
  • The important logs are in the END step (i.e. SonarQubeAnalyze / SonarCloudAnalyze / “Run Code Analysis”)

Share the msbuild verbose logs

MsBuild.exe /t:Rebuild /v:d

or

dotnet build -v:diag

I can send a private message if you don’t want to share them here.