danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.

Home Page:https://reportgenerator.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The generated (GeneratedRegex) codes are count as uncovered branches in v5.2.0

hamidmayeli opened this issue · comments

Describe the bug
I have updated from 5.1.13 to 5.2.0 and now I have 16 uncovered branches as the result of the following code.

[GeneratedRegex("\\{([A-Z]+?)\\}")]
private static partial Regex ParameterRegex();

image

@hamidmayeli
Your issue is probably not related to the new release. I did not make any changes in that area.
To verify that, it would be great if you could share your coverage file.
You can send it privately via email: reportgenerator@palmmedia.de

@danielpalme
Thanks for your reply. I have sent you the files. Also, I notice the issue exists in v5.1.26.

I haven't looked in details but could it be this commit 5825771?

The class System.Text.RegularExpressions.Generated is included in the report starting with release 5.1.18.

The is related to 3364c96 which fixed #590 and #591.

Before the whole class was not present in the report. Now as it is present, you have some uncovered branches.
But I don't think that this is related to the regex.

The regex should exist in line 23.

The branches in that file however are in the following lines:

  • 71: 4 of 6 branches covered
  • 76: 1 of 2 branches covered
  • 91: 2 of 2 branches covered
  • 96: 2 of 2 branches covered
  • 99: 2 of 2 branches covered
  • 108: 2 of 2 branches covered
  • 113: 2 of 2 branches covered
  • 138: 2 of 4 branches covered
  • 153: 1 of 2 branches covered
  • 158: 1 of 2 branches covered
  • 172: 2 of 4 branches covered
  • 188: 0 of 2 branches covered
  • 204: 1 of 2 branches covered

In total that's 22 of 34 branches covered.

If you want to exclude that file from the report, you can use a filter:
E.g. -classfilters:-System.Text.RegularExpressions.Generated