# Coverage seems to be off

**URL:** <https://community.codecov.com/t/coverage-seems-to-be-off/2077>\
**Category:** Support\
**Tags:** javascript, github\
**Created:** [September 24, 2020, 7:21am UTC](https://community.codecov.com/t/coverage-seems-to-be-off/2077 "2020-09-24T07:21:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shirblc](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@shirblc](https://community.codecov.com/u/shirblc)\
**Post date:** [September 24, 2020, 7:21am UTC](https://community.codecov.com/t/coverage-seems-to-be-off/2077/1 "2020-09-24T07:21:54Z")

</div>

### Description

When I run my tests, both locally and on Travis CI, I get a coverage report, but when the data is sent to codecov (via the codecov package), the report codecov presents is suddenly different. Coverage drops by 10% or so, and the report I see on codecov doesn’t match the HTML report I get running the tests.

### Repository

[https://github.com/sendahug/send-hug-frontend/tree/webpack-replace](https://github.com/sendahug/send-hug-frontend/tree/webpack-replace)

(Webpack replace branch specifically, although the reports on the Dev branch never matched either, but the difference was significantly smaller.)

### CI/CD

Travis CI.

### Uploader

I’ve tried both the codecov NPM package and the bash uploader. Same results.

### Commit SHAs

For example: 5650269188dd66ea59d82a606ec06d9c7fb79ff7, 4e41c95bfa46bcfd655edc2b428f375feb7984bc, b872248dd9f4eaf0d0e6ecca3b8d94b6f04c7af2

### Codecov YAML

None.

### Codecov Output

Seems to be too long to post here, but you can see it here: [Travis CI](https://travis-ci.com/github/sendahug/send-hug-frontend/jobs/390285188#L860)

### Additional Information

Nothing I can think of.

---

<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:** [September 29, 2020, 2:00pm UTC](https://community.codecov.com/t/coverage-seems-to-be-off/2077/2 "2020-09-29T14:00:42Z")

</div>

Hi @shirblc, could you provide the [html summary](https://travis-ci.com/github/sendahug/send-hug-frontend/jobs/390285188#L816)?

---

<div class="post-metadata">

**Author:** ![shirblc](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@shirblc](https://community.codecov.com/u/shirblc)\
**Post date:** [September 30, 2020, 3:00pm UTC](https://community.codecov.com/t/coverage-seems-to-be-off/2077/3 "2020-09-30T15:00:41Z")

</div>

Hi @tom, I wasn’t sure how to post it here so I uploaded it to my Drive; I hope it’s okay.

Here’s the [link](https://drive.google.com/drive/folders/1j6f_6z5gVTzGgmqsL_lkuC3aowgrQ4yv?usp=sharing).

---

<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:** [October 6, 2020, 4:00am UTC](https://community.codecov.com/t/coverage-seems-to-be-off/2077/4 "2020-10-06T04:00:03Z")

</div>

Hi @shirblc, thanks for this! I think I figured out why it looks off. The most important thing is that Codecov takes into account branch coverage and does NOT consider a partially covered as hit.

For example, we can take a look at `src/app/components/aboutApp/aboutApp.component.ts`. This is what we see in the HTML

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/1/147725e35bc8d11f081987edfce157fbbd4055e0.png)

Take particular note of the line coverage of 13/13.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/1/10a3d0d129a7f4d7ea26539bb2165849ed1e7ba7.png)

In Codecov, we see 13 total lines here too, but 5 are partially covered. Where did they come from?

Digging into the raw lcov.info file, we see

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/3/38509f6a7c6b332fe02fa7edfc3cda3df61e4304.png)

BRDA specific branch coverage. There are 29 statements here (as matches the HTML branches). If you see lines marked with a `0` at the end, it means that branch was not taken as described [in the docs](http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php) (`BRDA:<line number>,<block number>,<branch number>,<taken>`)

So what does this mean? Codecov interprets your branch coverage and thus you see coverage seem to be off.
