Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't report missing branches to missing lines. #1065

Closed
tolomea opened this issue Nov 30, 2020 · 4 comments · Fixed by #1128
Closed

Don't report missing branches to missing lines. #1065

tolomea opened this issue Nov 30, 2020 · 4 comments · Fixed by #1128
Labels
enhancement New feature or request fixed
Milestone

Comments

@tolomea
Copy link

tolomea commented Nov 30, 2020

This is a small quality of life suggestion that would make coverage reports easier to read.

Is your feature request related to a problem? Please describe.
Branch coverage can make missing coverage reports difficult to read.

Describe the solution you'd like
Reporting missing branches to missing lines is redundant, if the line didn't get covered then obviously any branches to it didn't either. Omitting these would make coverage reports shorter and easier to read in a lot of cases.

Lets consider one block of 20 lines in one of my files. The missing section of the coverage report looks like this:

496->497, 497, 500->504, 504, 506->510, 510, 512->516, 516

In my humble opinion all of these particular branch reports are unnecessary. Not reporting them would significantly reduce the cognitive load of going through this info and addressing the misses.

497, 504, 510, 516

Of course some branch reports contain useful information. I'm just talking about ones that go to lines that are already going to be reported as missing.

@nedbat
Copy link
Owner

nedbat commented Feb 24, 2021

I see your point :)

@nedbat nedbat added this to the 5.next milestone Feb 24, 2021
nedbat added a commit that referenced this issue Feb 28, 2021
nedbat added a commit that referenced this issue Feb 28, 2021
@nedbat nedbat added the fixed label Feb 28, 2021
@nedbat
Copy link
Owner

nedbat commented Feb 28, 2021

This is now released as part of coverage 5.5.

@tolomea
Copy link
Author

tolomea commented Feb 28, 2021

Thank you

@leon-matthews
Copy link

This fix is very much appreciated, thank you both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants