# Fields

Trend Metric Trend Metrics / Code Size

Counts all non-compiler-generated application fields that are neither enumeration values nor constants, showing per field the technical-debt and issues.

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="# Fields" Unit="Fields" />
from f in Application.Fields.Where(f => 
   !f.IsEnumValue && 
   !f.ParentType.IsEnumeration &&
   !f.IsGeneratedByCompiler && 
   !f.IsLiteral)
select new {
   f,
   Debt = f.AllDebt(),
   Issues = f.AllIssues()
}

//<Desc>
// Counts all non-compiler-generated application fields that are neither
// enumeration values nor constants, showing per field the technical-debt
// and issues.
//</Desc>

Trend Metrics / Code Size: all 22 items