# Lines of Code in Types 100% Covered

Trend Metric Trend Metrics / Coverage

A covered line is even more valuable in a type 100% covered. Covering 90% of a class is not enough: the 10% uncovered is hard-to-test, hence not well-designed, hence error-prone. Better test error-prone code, isn't it?

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 in Types 100% Covered" Unit="LoC" />
Application.Types.Where(t => t.PercentageCoverage == 100)
                 .Sum(t => t.NbLinesOfCodeCovered)

//<Desc>
// A covered line is *even more valuable* in a type 100% covered. Covering
// 90% of a class is not enough: the 10% uncovered is hard-to-test, hence
// not well-designed, hence error-prone. Better test error-prone code,
// isn't it?
//</Desc>

Trend Metrics / Coverage: all 12 items