Branch analysis results differ between SonarQube DataCenter and SonarQube Community

What Am I Trying to Achieve:

  • Branch analysis parity between local docker sq and sq cloud

What have you tried

  • running same code through local and sonarcloud

Here is the result - same file, unchanged between analysis, first image is on SonarQube DataCenter
datacenter

This is via the SQ Community 8.2 in docker:
community2.2

Environment details:

  • target language language: dotnetcore 3.1 (c#)
  • code coverage reporting tool : dotCover 2020.2

Local Docker SonarQube
Must-share information:

  • SonarQube Community 8.2 - image available via public Docker registry
    *SonarScanner: dotnet tools 4.8.0

SonarCloud

  • Data Center Edition
  • Version 8.3.1 (build 34397)
  • SonarScanner: dotnet tools 4.8.0

edit: to be clear - not asking for unit test advice ~ im asking for analysis parity. There is a project that takes an exceptionally long time to build on our CI pipeline, and I am interested in gathering sq code analysis results prior to offering a PR branch (which includes analysis as well as numerous, lengthy validation steps i do not wish engage in just to receive code analysis results)

You’re best off comparing the exact same versions of SonarQube

See this upgrade note for SonarQube v8.3, which probably explains the difference.

Updated .NET code coverage
The code coverage for .NET projects now takes into account the branch/condition coverage in addition to the line coverage. The coverage of your projects may decrease to be closer to reality, and it can impact your Quality Gate. (See more details here).

1 Like

Ah! I’ll give that a shot