How is NCLOC getting calculated in NCoverHTML rep?

How is NCLOC getting calculated in NCoverHTML rep?

Hi Need information on 'Project Statistics' displayed on NCover HTML report. How is NCLOC is calculated? what does this figure indicate?

For Ex : If i have 1000 dlls and have a test dll which touches 400 out of 1000 dlls. Now when i generate a coverage report, I see that NCLOC shows coverage data for only 400 dlls. what about remaining 600 dlls? they are not even counted while profilling. does NCLOC figure includes this also?

Waiting for the quick reply.

Thanks


RE: How is NCLOC getting calculated in NCoverHTML rep?

The NCLOC is the number of lines that contain sequence points.

The majority of the time this will not include your method signature since it does not contain a sequence point.

It does represent a percent of your code, just a number.

Only the dll's loaded into the process are counted. We don't attempt to load references. If you want the dll's loaded, most people write at least one test that loads the other dll's that they would like covered.

Does that help?

Joe Feser


RE: How is NCLOC getting calculated in NCoverHTML rep?

We need a basis to map the NCLOC generated by our in-house tool and that generated by NCover.

Our in-house tools traverses through the source files (and not the PDBs) and it can generate some kind of number for NCLOC.

However, Since NCover counts only those assemblies that are in the purview of the process, it can't give us an accurate figure for the NCLOC for our whole set of deliverable binaries.

Can NCover be used to take NCLOC for these other assemblies also? I am just interested in measuring this number for all the .NET libraries in a particular folder. Is there a way this can be achieved?

Any suggestions?


RE: How is NCLOC getting calculated in NCoverHTML rep?

One dirty and quick way of doing it is to load all the assemblies required in a Nunit Test case using Reflection. This test can be covered using NCE and in this way, we can get the Sq Pts for all the required assemblies.

This shall give me an indication of NCLOC for all the modules loaded, albeit the coverage will be zero.

What I would expect is for NCover to provide such an interface to load [autoload] modules of interest, so that I can get to know the number of Sq Pts for each of those assemblies.


RE: How is NCLOC getting calculated in NCoverHTML

why do you want to compare NCover's NCLOC with that from the other tool?

Several times in the past we've considered adding the ability to NCover to load modules that aren't used by the executing code, but we've always decided not to do it because NCover is a code coverage tool, and not designed for static analysis. The existing NCLOC calculation is a holdover from NCover's days as a free tool.