How to collect code coverage about new code in branch analysis

I’m using SonarCloud at Java and Kotlin project.
with Github, drone CI, jacoco.

I want to calculate branch test coverage but I can’t.

  1. condition coverage is default setting on SonarCloud? How can I change it to branch coverage?

  2. Below image is my condition. (test coverage is collected. but not collected for additional code lines)

I use Drone Ci but SonarCloud is not support it officially. So I use gradle command.

on build.gradle.kts file

on drone ci setting file.

Hey there.

SonarQube calculates a combined metric of branch/condition coverage that is shown on the project dashboard, see the documentation for the coverage metric here.

It looks like the root problem is that no code was detected as having been added. Are there any warnings emitted from your ./gradlew sonarqube run? Did you actually add source code (rather than test code, or config files) in this pull request?