Gcov LOC vs Sonarqube

Must-share information:

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension), via official Sonarqube docker image - no proxy.
C++ community 1.0.0

  • what are you trying to achieve
    I want the same coverage numbers between gcov/gcovr and Sonarqube

  • what have you tried so far to achieve this
    I am running my coverage with gcov and using gcovr to generate local reports for C++. My local report is 30% higher than what gets reported from Sonarqubube.

Looking into the details, it seems that the LOC count is different.

Under Sonar, there are 2023 lines and 1,581 LOC with .6% coverage
gcovr reports, 705 total lines at 2.4% coverage

Is there any way to sync these numbers up?


The Cxx plugin has its own community. You should ask this there.