This project has moved. For the latest updates, please go here.

Suggestion to improve "X of Y branches are covered"

Oct 23, 2014 at 8:35 PM
The tooltip that is displayed when I hover my mouse over the new "branch" icon is really great. It's really helpful to find if" or "switch" statements where I forgot to cover one of the branches.

However, I have several methods with coverage in the 90-95% range and it's not obvious which branch I forgot to cover. In this situation I have to hover my mouse over each icon, wait a second or two for the tooltip to be displayed, move my mouse to the next icon and repeat until I find the culprit. Eventually, I find the branch that I did not properly cover but it's a little bit tedious.

In addition to the tooltip, would it be possible to change the background color to help me more easily identify this scenario?

Here's what I suggest:
  • If zero branches are covered, background color is red (this the current behavior)
  • If all branches are covered, background color is green (this is the current behavior)
  • If at least one but not all branches are covered, background is yellow (new behavior)
Hopefully this makes sense.
Oct 24, 2014 at 7:13 AM
Thanks for your suggestion.

Currently green/red is only used to indicate line coverage. I'm not sure if mixing this with branch coverage is intuitive.

How do you think about changing the color of the branch icon?
Oct 24, 2014 at 2:14 PM
Changing the color of the icon is fine too. In fact, any visual indicator would be fine. What's important to me is that I have a way to quickly and easily identify uncovered code and branches.
Oct 28, 2014 at 12:09 PM
I will implement this feature within the next 1-2 weeks.
Oct 31, 2014 at 9:24 PM
I added a vertical bar indicating the coverage percentage.

It would be great if you could test the latest beta on Nuget:

Please use a modern browser which supports border-image:
Marked as answer by danielpalme on 1/6/2015 at 2:33 AM
Nov 4, 2014 at 10:13 PM
The vertical bar is a little bit small, but it's gives me exactly the information I need so it's fine. I like it!
Jan 10, 2015 at 5:30 PM
I like the new bar. It helps me understand which branches are not covered when looking at the specific files. Would it be possible to also see statistics on uncovered branches in the summary page? I have a file right now that is generally reporting as 100% covered even though there is one branch that I have not covered with a test.
Jan 11, 2015 at 8:22 AM
Good idea. I will see how I can integrate the branch results in the summary page.
But this may take some time, since I'm quite busy.
Jan 12, 2015 at 6:22 PM
Please have a look at this beta release:

Let me know if this works for you.
Jan 12, 2015 at 9:52 PM
That works great. Thanks!