NCLOC and seqPoints

NCLOC and seqPoints

There is difference in NCLOC and total sequence points numbers. Why this difference exists ? . How NCover works in this aspect.

Thanks


RE: NCLOC and seqPoints

NCLOC is 'non-comment lines of code' and there can be multiple sequence points on a single line of code, so the total # of sequence points should always be higher than NCLOC


RE: NCLOC and seqPoints

Thanks for reply, I m aware of the NLOC abbreviation. Anyway In our case This is reverse, what could be the reason. NLOC > sequence points..


RE: NCLOC and seqPoints

on the othe hand, some sequence points span multiple lines (LINQ is the most common offender here)


RE: NCLOC and seqPoints

How we can find out that some sequence points are span multiple lines.?


RE: NCLOC and seqPoints

There is no way in the ide to determine this, but you could create an xslt or .net app to determine this information.

You could also use Linq to NCover

http://blog.joefeser.com/post/Linq-To-NCover-Part-2.aspx

You would need to use this statement

CodeCoverage c = CodeCoverage.Load(file);

var retVal = from mod in c.Modules from cls in mod.Classes from method in cls.Methods from sp in method.SequencePoint where sp.StartLine < sp.EndLine select method;

Thank you, Joe Feser