Code coverage for withContext in Kotlin shows 4 conditions and only 2 is covered

  • versions used SonarQube sonarqube-gradle-plugin version 2.8
  • Code coverage for Kotlin shows that withContext() command has 4 conditions and in case line is covered only two conditions covered, however it isn’t clear what conditions it has and how to cover rest two. For example of line is here:
    val element = withContext(backgroundDispatcher) {
    shows 4 conditions
    Analyze code coverage for Kotlin that has withContext function
  • potential workaround - no workaround found.


SonarQube imports the coverage report which is generated externally. So I suggest you to check the content of the coverage report and the way it’s generated.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.