Debt and Issues per Code Element

Code Query Hot Spots

Lists code elements with issues, most Debt (estimated fix effort) first.

Debt estimates distance from clean code, not fix priority. Annual Interest estimates the annual cost of leaving issues unfixed (Severity derives from it). The Debt Breaking Point is when the cost of leaving issues unfixed equals the fix effort: the shorter, the higher the ROI — the Breaking Point is the right metric to prioritize issues fix.

CQLinq source

This code query 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.

// <Name>Debt and Issues per Code Element</Name>
from elem in CodeElements
where elem.HasIssue()
orderby elem.Debt().Value descending
select new { 
   elem, 
   Issues = elem.Issues(), 
   Debt = elem.Debt(), 
   AnnualInterest = elem.AnnualInterest(), 
   BreakingPoint = elem.BreakingPoint()
}

//<Desc>
// Lists code elements with issues, most *Debt* (estimated fix effort) first.
//
// *Debt* estimates distance from clean code, not fix priority. *Annual
// Interest* estimates the annual cost of leaving issues unfixed (*Severity*
// derives from it). The **Debt Breaking Point** is when the cost of leaving
// issues unfixed equals the fix effort: the shorter, the higher the ROI —
// the **Breaking Point is the right metric to prioritize issues fix**.
//</Desc>

Hot Spots: all 7 items