Branch coverage is not showing the correct number
See original GitHub issueI have two different situations in which I believe the reported coverage is incorrect. Please let me know if this is the expected behaviour and if/how I could get these branches covered.
Situation 1:
<method name="GetPendingInvitationsByTypeAsync" signature="()" line-rate="1" branch-rate="1" complexity="NaN">
<lines>
<line number="111" hits="18" branch="false" />
<line number="112" hits="18" branch="false" />
<line number="113" hits="18" branch="false" />
<line number="114" hits="18" branch="false" />
<line number="117" hits="18" branch="false" />
<line number="121" hits="18" branch="false" />
<line number="123" hits="18" branch="false" />
<line number="124" hits="18" branch="false" />
</lines>
</method>
I would have expected line 118, 119 and 120 to show coverage as well just like line 112, 113 and 114. I also expected that due to the .Where clause this would create multiple different branches.
Situation 2:
I’m using EFCore and calling AddAsync seems to have resulted in 2 different branches.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Fixing Branch Coverage Sonar issue - java
I am trying to run sonar and i take a sample of my code a sampleClass to fix the branch coverage issue: The...
Read more >What Is Branch Coverage and What Does It Really Tell You?
What is branch coverage? That's the question we'll answer today. You'll learn what this metric is all about and how it can help...
Read more >What's a Branch and How to Make Sure It's Covered
Use a code coverage tool, our coverage tool lets you see the exact branch coverage, the amount of entries in each condition and...
Read more >Code coverage on branches does not break quality gate
I am currently working with a test instance and an evaluation license. I am facing the following problem: Somehow, code coverage does not...
Read more >IDEA shows uncovered branches but I cannot find ...
IDEA shows uncovered branches but I cannot find conditions to solve it and Sonar shows all conditions are covered.
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 FreeTop 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
Top GitHub Comments
I’ve tried to create a repro at https://github.com/dannyBies/CoverletIssueRepro. Unfortunately it doesn’t seem like I can get the issue to appear and I’m not sure why.
Ok np thank’s a lot for your time/help, very appreciated!