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

Show branch stats, not just percentages #364

Closed
sixeyes opened this issue Jul 30, 2020 · 12 comments
Closed

Show branch stats, not just percentages #364

sixeyes opened this issue Jul 30, 2020 · 12 comments

Comments

@sixeyes
Copy link

sixeyes commented Jul 30, 2020

The coverage report summary screen shows the branch coverage % for each file. Unfortunately due to async statements in my code I end up with some branches I can't cover. For a particular file I know that 3 branches aren't covered. As I add code to the file it would be really useful if I could see those statistics (covered branches / total branches). This way I would know if they differed by 3 I'd covered all the other branches from the summary page. I realise there isn't much room on the report, so I'd be happy with 29/32 90%.

Earlier today the branch coverage for the file was 25/29 86% and it wasn't obvious I hadn't covered one of the branches but there is a difference of 4, (which can be determined from the statistics when clicking on a file but not on the summary screen).

In fact while writing this I realise that if space is tight, just reporting the number of uncovered branches for each file would give me what I'm after.

I'm using VS2019, AltCover and .NET v4.7.2 if that makes any difference.

image

@danielpalme
Copy link
Owner

In general a good idea. The problem is the limited space.

Would a tooltip be helpful for you?

@sixeyes
Copy link
Author

sixeyes commented Jul 30, 2020

A tooltip would be good.

If the number of uncovered branches is on the summary, the number changing would get my attention where a tooltip would not.

Perhaps it should only be shown if there are uncovered branches.
Could it be added in the area I circled? Perhaps the number could be left justified, so it's up against the line coverage bar?
Could it only appear if there's a command line option?

@danielpalme
Copy link
Owner

I can't add it to the circled area. That's used for the history chart:
image

I have always tried to keep the number of possible command line parameters as small as possible and only added new parameters, when I was convinced that they are easy to understand and useful for the majority of the users.
Otherwise ReportGenerator would end up with (too) many parameters that no one understands.

I'm not sure if this parameter is really useful for the majority of the users.

@sixeyes
Copy link
Author

sixeyes commented Jul 30, 2020

What do I have to do to see the history chart?

I guess I'm going to ask for a tooltip as it's better than nothing. I do understand the issue with command line parameters.

How about an environment variable :)

@danielpalme
Copy link
Owner

danielpalme commented Jul 31, 2020

To see the history add the -historydir:YOUR_PERSISTENT_DIRECTORY command line parameter.

Environment variables are even worse :-) They are not discoverable.

I will add a tooltip in the next release.

@sixeyes
Copy link
Author

sixeyes commented Jul 31, 2020

Perhaps the uncovered branch count could appear in the area reserved for the history chart if that's not been requested?

So if -historydir is not present it could show the number of uncovered branches (if greater than zero)?

If -historydir is present, it's only available as a tooltip?

@danielpalme
Copy link
Owner

danielpalme commented Aug 2, 2020

Release 4.6.3 adds the tooltips.

I don't like the idea with -historydir. If the history flag is not set, a "random" number would appear and it wouldn't be obvious how to interpret that number.

Perhaps I'll add two additional columns to the table in the future. Still a space problem. But at least it would be easy to understand.

@sixeyes
Copy link
Author

sixeyes commented Aug 3, 2020

Could there be a command line option to change % values to fractions?

Instead of seeing 88.5%, it would show 23/26.

BTW I've just downloaded v4.6.4 but I can't see any tooltips in the report. Using Firefox v79.0. Do I need to change my configuration?

@danielpalme
Copy link
Owner

Tooltip works fine for me with Firefox:
image

Sample reports: https://github.com/danielpalme/ReportGenerator/blob/master/docs/resources/SampleReports.zip

I thinking about a radio button to switch between percentage / ratio.
But will take a while, since I'm on vacation.

@sixeyes
Copy link
Author

sixeyes commented Aug 4, 2020

OK. I can see them now. Apparently I have to stop moving the mouse before Firefox will show them.

Radio button sounds good. Have a great time on holiday.

@danielpalme
Copy link
Owner

I finally added two additional columns in release 4.6.5:
https://www.nuget.org/packages/ReportGenerator/4.6.5

@sixeyes
Copy link
Author

sixeyes commented Sep 2, 2020

Thanks very much. Just tried it, it's perfect :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants