Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code coverage on Android/Kotlin with Kover and Sonar differs on percents

I'm using Kover to get coverage on kotlin and want to share it with sonar, configuration is like this:

plugins {
  ...
  id "org.jetbrains.kotlinx.kover" version "0.4.2"
  id "org.sonarqube" version "3.3"
}

sonarqube {
    properties {
        property "sonar.sourceEncoding", "UTF-8"
        ...
        property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/report.xml"
    }
}

project.tasks["sonarqube"].dependsOn "koverReport"

Now, the HTML report of Kover says I have 33% of coverage meanwhile Sonar shows a 10% coverage. What could be the problem?

like image 831
Zoo_M-0 Avatar asked Oct 15 '25 20:10

Zoo_M-0


1 Answers

The simple answer is that they are computed differently: https://community.sonarsource.com/t/sonarqube-and-code-coverage/4725 .

like image 165
David M. Karr Avatar answered Oct 18 '25 10:10

David M. Karr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!