# Project coverage decrease on deleted line

**URL:** <https://community.codecov.com/t/project-coverage-decrease-on-deleted-line/2726>\
**Category:** Bug Fixes\
**Created:** [April 5, 2021, 8:21pm UTC](https://community.codecov.com/t/project-coverage-decrease-on-deleted-line/2726 "2021-04-05T20:21:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adiroiban](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/adiroiban/32/1723_2.png) [@adiroiban](https://community.codecov.com/u/adiroiban)\
**Post date:** [April 5, 2021, 8:21pm UTC](https://community.codecov.com/t/project-coverage-decrease-on-deleted-line/2726/1 "2021-04-05T20:21:14Z")

</div>

First, I would like to thank you for the nice codecov. io project

PR on GitHub is here [Remove redundant code by hexagonrecursion · Pull Request #334 · twisted/towncrier · GitHub](https://github.com/twisted/towncrier/pull/334)

Here is this diff [Code coverage done right.](https://codecov.io/gh/twisted/towncrier/compare/3c8a92bba0f6967d97b7fd0b05abc0cf4dc67ba4...34bcd2b88beb483979e1913b202decdc6e3d141f/diff)

There is a line of unused code that was removed.

Codecov delta is reporting a decrease in coverage.

I think that this is bug as that line was removed since it was doing nothing. it was just a useless assignment without any side effects.

I am reporting this as maybe this is a simple example that can help improve your algorithm.

Regards

---

<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 6, 2021, 8:23pm UTC](https://community.codecov.com/t/project-coverage-decrease-on-deleted-line/2726/2 "2021-04-06T20:23:56Z")

</div>

@adiroiban, thanks for the bug report, this is definitely useful. The reason for the decrease in reporting is actually just math. For example, a repo with 3 lines of code that have 2 lines covered will have lower coverage when one of the covered lines is removed

`2/3 > 1/2`

---

<div class="post-metadata">

**Author:** ![wyfo](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/wyfo/32/1381_2.png) [@wyfo](https://community.codecov.com/u/wyfo)\
**Post date:** [January 1, 2022, 9:28pm UTC](https://community.codecov.com/t/project-coverage-decrease-on-deleted-line/2726/3 "2022-01-01T21:28:11Z")

</div>

Same case here: [Support arbitrary dictionary keys by wyfo · Pull Request #307 · wyfo/apischema · GitHub](https://github.com/wyfo/apischema/pull/307)  
I’ve removed two useless assertions, and my pipeline fails…

This is indeed an annoying bug. Will it be fixed soon?
