Coder Social home page Coder Social logo

Comments (8)

danielpalme avatar danielpalme commented on August 20, 2024

Hi Stephen,

nested types are not ignored.
ReportGenerator processes coverage reports in the following way:

  1. Collect classes of assembly (without nested classes), see line 191
  2. Then every class with all nested types is processed, see line 274

That means that the summary page only shows the main classes. But if you take a look at a class report, also the nested classes are included.
E.g. have a look at ConcurrentBag. Only the main class shows up in index.htm, but nested types like Node or ThreadLocalList show coverage information as well.
See lines 837-1001 in ConcurrentBag_1.htm

from reportgenerator.

stephentoub avatar stephentoub commented on August 20, 2024

Thanks for following up, Daniel! I should have been clear that there are different issues for different nested types. I can understand that it's a design choice that ones like you mentioned don't show up in the main list of types. But, for example, this code https://github.com/dotnet/corefx/blob/master/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs is in System.Security.Cryptography.RandomNumberGenerator, and it's type shows up in the OpenCover output XML file, but I can't find Interop or BCrypt anywhere in the report for that library. Am I just missing it?

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

Can you please provide me the corresponding OpenCover XML?
Perhaps something is wrong with partial nested classes.

I have to debug this with the report.

from reportgenerator.

stephentoub avatar stephentoub commented on August 20, 2024

Thanks:
http://dotnet-ci.cloudapp.net/job/dotnet_corefx_coverage_windows/lastStableBuild/artifact/bin/tests/coverage/System.Security.Cryptography.RandomNumberGenerator.Tests.coverage.xml

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

The problem is, that the outer class Interop does not contain any methods, constructors etc.
It only contains the nested class BCrypt.

When ReportGenerator collects the name of all classes (see my comment above), the class Interop is not taken into account, because the OpenCover report does not contain any information about this class.
Therefore the nested class BCrypt is not considered too.

I think I can change this in ReportGenerator wihin the next 2-3 days.

from reportgenerator.

stephentoub avatar stephentoub commented on August 20, 2024

Thanks, Daniel.

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

Could you please test again with version 2.1.6.0?
It should work as expected.

I created a sample nested class myself. OpenCover tracked the wrapper class, although it did not have any members. Strange that this does not happen for your Interop class.

from reportgenerator.

stephentoub avatar stephentoub commented on August 20, 2024

Thanks, @danielpalme! Seems to be fixed.

from reportgenerator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.