# Java Jacoco branch coverage support

**URL:** <https://community.codecov.com/t/java-jacoco-branch-coverage-support/4270>\
**Category:** Support\
**Tags:** java, github\
**Created:** [April 13, 2023, 1:01am UTC](https://community.codecov.com/t/java-jacoco-branch-coverage-support/4270 "2023-04-13T01:01:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zetelight](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/zetelight/32/3006_2.png) [@zetelight](https://community.codecov.com/u/zetelight)\
**Post date:** [April 13, 2023, 1:01am UTC](https://community.codecov.com/t/java-jacoco-branch-coverage-support/4270/1 "2023-04-13T01:01:44Z")

</div>

## Before submitting a topic, please confirm the following

I have searched for similar issues before creating this topic.  
 I have verified that my repository is using the [Codecov GitHub app](https://github.com/apps/codecov), if using GitHub  
 I have [validated](https://docs.codecov.com/docs/codecov-yaml#validate-your-repository-yaml) my `codecov.yaml` configuration file.  
 I have filled out the below sections to the best of my ability.  
 I understand that the community boards are a free, best-effort tool. While we hope to have someone on the Codecov team resolve your problem quickly, this is not always possible.

### Description

Hello, I just started trying Codecov and it’s wonderful in terms of usability and UX.  
Per [the doc](https://docs.codecov.com/docs/about-code-coverage), the current coverage is done by `hits of lines / (sum of hit of lines + partial hit lines + missed lines)`. However, I’d like to know if Codecov can support using `branch coverage` for Java jacoco instead of `line coverage`.

Don’t want to start a debate on branch coverage vs line coverage but having this being a pluggable config would open up more flexibility if we decided to switch from branch coverage to line coverage and vice versa.

### CI/CD URL

N/A

### Codecov Output

N/A

### Expected Results

We’d like to see the coverage can be “branch coverage” reported by Jacoco, which is 62%.  
 ![Screenshot 2023-04-12 at 5.59.19 PM](https://canada1.discourse-cdn.com/flex029/uploads/codecov/optimized/2X/0/01572af5d46974cb32c4b55e3c6cfb6569b3eaaa_2_689x39.png)

### Actual Results

The current coverage is done by 11 / (11 + 2 + 2) = 73.3%, which is less desired. Please see my screenshot below.

---

<div class="post-metadata">

**Author:** ![zetelight](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/zetelight/32/3006_2.png) [@zetelight](https://community.codecov.com/u/zetelight)\
**Post date:** [April 13, 2023, 1:02am UTC](https://community.codecov.com/t/java-jacoco-branch-coverage-support/4270/2 "2023-04-13T01:02:34Z")

</div>

Since new user can only post one image, let me attach another screenshot for the “Actual Results”

 ![Screenshot 2023-04-12 at 5.58.51 PM](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/7/786ecc93a14aaaa3f5f6cdcbcafb58b58c13cf6a.png)

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [April 18, 2023, 6:43am UTC](https://community.codecov.com/t/java-jacoco-branch-coverage-support/4270/3 "2023-04-18T06:43:44Z")

</div>

Hi @zetelight this is currently not possible, but I would suggest adding a topic in our [feedback](https://app.codecov.io/gh/feedback) section so that the product team can be aware.
