# Lines of Code Uncoverable

Trend Metric Trend Metrics / Coverage

Number of lines of code Uncoverable: lines in methods without coverage data in the imported file plus methods explicitly excluded from coverage — via a .runsettings file (Project Properties > Code Coverage > Settings > Exclusion Coverage File) or an Uncoverable attribute (typically ExcludeFromCodeCoverageAttribute; custom ones definable in Settings > Un-Coverable attributes; with VS coverage, DebuggerNonUserCodeAttribute and DebuggerHiddenAttribute count too).

If coverage data is not in-sync with the code base, methods missing from the data are also listed.

CQLinq source

This trend metric is written in CQLinq, C# LINQ over the NDepend code model. It ships with every new NDepend project: you can read it, adapt it, or use it as a starting point for your own custom rules.

// <TrendMetric Name="# Lines of Code Uncoverable" Unit="LoC" />
Application.Methods.Where(m => !m.CoverageDataAvailable).Sum(m => m.NbLinesOfCode).ToNullableDouble()

//<Desc>
// Number of **lines of code Uncoverable**: lines in methods without
// coverage data in the imported file plus methods explicitly excluded from
// coverage — via a *.runsettings* file (*Project Properties > Code Coverage >
// Settings > Exclusion Coverage File*) or an *Uncoverable
// attribute* (typically *ExcludeFromCodeCoverageAttribute*; custom ones
// definable in *Settings > Un-Coverable attributes*; with VS coverage,
// *DebuggerNonUserCodeAttribute* and *DebuggerHiddenAttribute* count too).
//
// If coverage data is not *in-sync* with the code base, methods missing
// from the data are also listed.
//</Desc>

Trend Metrics / Coverage: all 12 items