ReportGenerator branch coverage does not match Cobertura input file
See original GitHub issueI’m running ReportGenerator on a Cobertura XML file and the file contains this:
<coverage line-rate="0.859" branch-rate="0.758" version="1.9" timestamp="1546449905" lines-covered="275" lines-valid="320" branches-covered="50" branches-valid="66">
When I view the report, ReportGenerator is saying that my Branch coverage is 88% and not 75.8%:

I’m not merging any output files or anything fancy. I just have one Cobertura file that gets generated and I pass that directly in to ReportGenerator. Why is this happening?
Version: ReportGenerator 4.0.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Mismatch between Branch Coverage in Cobertura and ...
We are generating code coverage using dotnet test, coverlet, and cobertura. We are using ReportGenerator to combine the coverage results and ...
Read more >Azure devops reportgenerator task can't find coverage. ...
The coverage.cobertura.xml is expected input file but it's not generated. In my experience, it's because your dotnet test task didn't ...
Read more >Code Coverage in VSTS with xUnit, Coverlet and ...
Here we are invoking the .Net Core CLI tool ReportGenerator.exe, as explained before, setting the input file to coverage.cobertura.xml, the ...
Read more >Publish code coverage results v1 task
Specifying a path to source files is required when coverage XML reports don't contain an absolute path to source files.
Read more >The Easiest Way to Generate and Publish .NET Code ...
This argument creates a $(Agent.TempDirectory)/*/coverage.cobertura.xml code coverage report file. This folder is default output folder since ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ok that makes sense. Thanks for the explanation @danielpalme!
Yes ReportGenerator does not reuse the numbers of the Cobertura file.
Reasons: