Comments (11)
Thanks for the detailed description and the sample.
I will have a look as soon as possible.
from reportgenerator.
We have been digging further, and now I'm not sure there's a problem with the library. Please put this on hold, I'll be back with a verdict shortly.
from reportgenerator.
They only thing that we would like to have is the ability to "see" these functions, i.e. be able to extract their metadata with
ReportGenerator.Core
library to show them on our dashboard, without affecting metrics.
I will see what I can do. Will come back to you as soon as possible.
from reportgenerator.
Thanks! I will test it in the following days and come back.
from reportgenerator.
After taking a quick glance at the code, I can see two things:
- Currently there's a special case for compiler-generated iterator methods:
- Lambdas (and consequently local functions) are excluded (which dates back to the initial import in 2015):
from reportgenerator.
I just found time to have a closer look. Sorry for the delay.
The main problem is that line and block coverages of these local functions is lost in the generated report. We have classes which mainly consist of local functions, and the coverage metrics are very off for them, compared to what Visual Studio shows.
Compiler generated classes are not listed on the summary page, that's correct. But the relevant lines are processed within the corresponding parent class.
In your example the summary report only shows the classes MyLogic
and MyScenario
.
But if you look into the MyScenario
report, you will see that all coverable lines are considered. Even the block with line 729-738, which belongs to a compiler generated class.
- Currently there's a special case for compiler-generated iterator methods:
Yes, but that's just a naming thing. The name MoveNext
is not very helpful, instead the "correct" method name is retrieved.
- Lambdas (and consequently local functions) are excluded
Yes, but only in the list of methods and their metrics. This does not affect the overall code coverage.
Does this help? I'm I missing something?
from reportgenerator.
The main issue we had is the 'Blocks covered' method metric which was incorrect (i.e. apparently not including compiler-generated local functions). It seems to me that the Lines metric is calculated correctly indeed.
Can you take a look at how it's calculated? Maybe the same 'aggregation' logic is missing for block coverage?
from reportgenerator.
And what about properties? They are excluded from the report too, do they count towards line metrics like compiler-generated methods do? In theory, property getters/setters can (and often do) have some logic in them, so they should count towards line/block coverage metrics.
from reportgenerator.
So our current understanding is that including lambda/local functions in total metrics (as suggested by me) is incorrect because they are already included by Visual Studio coverage. So the premise of this bug report is false, sorry for that.
They only thing that we would like to have is the ability to "see" these functions, i.e. be able to extract their metadata with ReportGenerator.Core
library to show them on our dashboard, without affecting metrics.
from reportgenerator.
I think I have found a solution. Will publish a new release in the next days.
from reportgenerator.
Release 5.1.26 is now available. Could you please test if this works for you?
from reportgenerator.
Related Issues (20)
- CLI argument to support custom naming of generated history files HOT 8
- Code Coverage report response causes garbled characters HOT 3
- minimumCoverageThresholds:lineCoverage not working HOT 12
- Issue with -reporttypes field HOT 1
- Wiki Edit HOT 1
- Unable to convert opencoverxml file into corbertura.xml file using ReportGenerator in Azure Devops Pipeline HOT 3
- Release notice confuses me. HOT 1
- Why is the reportgenerator command installed using the dotent not working? HOT 2
- Report generated is always at version 5.1.14.0 on AzureDevops HOT 1
- Allow to specify the root path HOT 1
- Question: Is the format created by the CTC++ tool supported as input for report generator? HOT 2
- MS Coverage output isn't cleaning compiler generated methods/types HOT 9
- Ability to exclude classes from Risk Hotspots HOT 6
- Error while converting jacoco report to cobertura HOT 12
- Suggestion for new report type: MarkdownTableShortSummary HOT 2
- Sonarqube format clashes with DeterministicSourcePaths=true HOT 5
- Azure DevOps task option publishCodeCoverageResults doesn't work with relative targetdir path HOT 2
- Azure pipeline failure due to dependency on NodeJS version 6 HOT 3
- Docs/readmes: add info about `minimumCoverageThresholds` HOT 2
- ReportGenerator 5.3.1 fails on self hosted azure devops agent running on Amazon Linux 2 arm64 instance (t4g) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reportgenerator.