Comments (11)
Your XML contains this information about branches:
<BranchPoints>
<BranchPoint vc="2" uspid="108875" ordinal="0" offset="56" sl="23" path="0" offsetend="58" fileid="3073" />
<BranchPoint vc="2" uspid="108876" ordinal="1" offset="56" sl="23" path="1" offsetend="69" fileid="3073" />
</BranchPoints>
This seems to be correct. And then the HTML report will show 2 of 2 branches covered.
I created a similar class and I get 2 branches with both are shown as covered in the report.
Do you pass a single coverage report to ReportGenerator or several files?
from reportgenerator.
Thanks for your amazingly fast response.
I have a batch file which executes the coverage, which just uses one results.xml. The line of code which executes the Report Generator is this;
..\packages\ReportGenerator.2.1.3.0\reportgenerator.exe -reports:results.xml -targetdir:CoverageReport
I do execute three unit test projects through OpenCover (which calls mstest with three testcontainer arguments). To be sure, I've checked the file id's, but there's only one file with id '3073' as in the example.
from reportgenerator.
Could you provide the full results.xml?
from reportgenerator.
I took a look at the results.xml you have sent me.
I think I found the reason why you get strange results.
Each of your unit test assemblies use a separate copy of the X.BusinessLayer.dll.
The X.BusinessLayer.dll is referenced 4 times. One test assembly covers the two branches the others don't cover the relevant code.
ReportGenerator groups the assemblies by their name and then shows 2 of 8 branches as covered.
To fix this issue try using the following option when executing OpenCover: -mergebyhash
https://github.com/OpenCover/opencover/wiki/Usage#optional-arguments
Please let me know if this helps.
from reportgenerator.
Yes, this helps. My issue is resolved. Thanks a lot for your outstanding support!
from reportgenerator.
@danielpalme, I think I have a similar problem, but OpenCover's -mergebyhash
isn't working for me.
The OpenCover XML is reporting significantly different numbers than I'm getting from ReportGenerator.
I'd be happy to send along my files for troubleshooting.
from reportgenerator.
Please send me your OpenCover file.
And (if possible) a class file, where you think something is wrong.
from reportgenerator.
@danielpalme, I'll be sending you my file soon.
Specifically, I'm not sure if my branch point data is inaccurate, but ReportGenerator says I have 1897 classes and 56.7% branch coverage, while my OpenCover output says I have 2443 classes (1549 visited) and 60.63% branch coverage.
from reportgenerator.
@danielpalme, just realized I should tell you I emailed my file to you, in case it gets caught in your spam filters 😄
from reportgenerator.
I received your files. I will look into them within the next days.
This wiki page explains some metrics of ReportGenerator: https://github.com/danielpalme/ReportGenerator/wiki/Calculation-details
from reportgenerator.
Thanks, I appreciate the help!
from reportgenerator.
Related Issues (20)
- Reportgenerator generated html and xml file is mismatched with its input Cobertura xml file HOT 4
- To combine multi coverage report HOT 1
- Issue with running the report generator in docker with image "mcr.microsoft.com/dotnet/sdk:7.0" HOT 2
- LCov: branch hit count can overflow Int32. HOT 1
- Files with 0% coverage are omitted from the coverage report HOT 8
- Report generator is looking for dotnet even the artifact is Python code HOT 1
- Cobertura report generation emits NaN as complexity for async functions HOT 2
- Visual Studio .coveragexml: ReportGenerator ignores compiler-generated classes HOT 11
- SixLabors.ImageSharp.Drawing has potential vulnerability HOT 6
- Risk Hotspots thresholds - what are the default values - and how change them HOT 1
- Visual Studio Coverage: Support partial line coverage HOT 6
- Cobertura output async "class" merging can create duplicate method entries HOT 10
- 10 days trial HOT 1
- coverlet-coverage give much higher Cyclomatic Complexity score for given Method then Visual Studio 2022 Code Metrics Results HOT 3
- The generated (GeneratedRegex) codes are count as uncovered branches in v5.2.0 HOT 4
- I don't manage to get the final results exposed in Azure DevOps UI HOT 2
- Downloaded file not found at path specified HOT 1
- Cobertura merge information loss HOT 8
- Projects with DebugType "Portable" experience internal server 500 error while reading source files. HOT 6
- Calculate C.R.A.P. Score from Cobertura file? HOT 7
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.