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

Does ReportGenerator Support "Source View" #703

Closed
bgyu opened this issue Oct 31, 2024 · 3 comments
Closed

Does ReportGenerator Support "Source View" #703

bgyu opened this issue Oct 31, 2024 · 3 comments
Labels

Comments

@bgyu
Copy link

bgyu commented Oct 31, 2024

This is not bug report, more like a feature request.
In Visual Studio Enterprise, we can view the report in "Source View" or "Project View". From current observation, it looks like ReportGenerator only supports "Project View". The view tree is based on assembly, namespace, class, functions.

When I click a source file, I can only see the coverage report for global functions, no class member functions. If I want to see class member functions, I have to click a specific type.

Is it possible that to show the coverage report in a source tree view? When I expand sources in a tree, it shows me what the coverages of a source file, which includes both global functions and member functions.

@danielpalme
Copy link
Owner

I'm not sure if I understand your request correctly. I have never used the "Visual Studio Enterprise".

Currently ReportGenerator generates an overview/summary page which list all assemblies and classes.
Then you can select a class and get the full coverage information for that class including all the source lines.
Here's a sample report: https://reportgenerator.io/resources/reports/Html/index.html

What are you missing? Can you provide a screenshot?

@bgyu
Copy link
Author

bgyu commented Nov 1, 2024

This is the example I want to show you between the report of VS Enterprise and ReportGenerator:

Project View

image
It shows a tree structure similar to ReportGenerator:
image
Summary is similar.
When I click "MyHello.BasicTests.cpp":
I only see the coverage of global function GlobalGreet, no coverage showed for class Hello:
image

When I click class MyHello.Hello:
image
It only shows me the coverage of member function Greet, no global function GlobalGreet showed here.

What I want to see coverage for both in the same source file, both of them should have a green background indicates both are covered, like the following "Source View" in VS Enterprise.

Source View

image

As you can see, the coverage of file BasicTests.cpp has global function GlobalGreet and a member function Greet of Hello class, both are showing in the same view. The coverage of BasicTests.cpp is for both global functions and member functions.

@danielpalme
Copy link
Owner

ReportGenerator works on a class by class basis. What you suggest is more a file by file basis.
The current approach works fine for languages like C# or Java. In those languages most files contain exactly one class.

I see, that this does not work well in your case. But I probably won't change the behavior since this would be a breaking change for all other users and would also mean to rewrite the complete tool. I'm sorry.

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

No branches or pull requests

2 participants