Debt and Issues per Rule

Code Query Hot Spots

Lists violated rules with 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 an issue unfixed equals the fix effort: the shorter, the higher the ROI — the Breaking Point is the right metric to prioritize issues fix.

--

Group rules by Rule Category to see which categories generate most Debt (typically Code Coverage by Tests, Architecture and Code Smells).

More documentation: https://www.ndepend.com/docs/technical-debt

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 Rule</Name>
from r in Rules
where r.IsViolated()
orderby r.Debt().Value descending
select new { 
   r, 
   Issues = r.Issues(), 
   Debt = r.Debt(), 
   AnnualInterest = r.AnnualInterest(), 
   BreakingPoint = r.BreakingPoint(),
   Category = r.Category
}

//<Desc>
// Lists violated rules with 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
// an issue unfixed equals the fix effort: the shorter, the higher the ROI —
// the **Breaking Point is the right metric to prioritize issues fix**.
//
// --
//
// Group rules by *Rule Category* to see which categories generate most *Debt*
// (typically *Code Coverage by Tests*, *Architecture* and *Code Smells*).
//
// More documentation: https://www.ndepend.com/docs/technical-debt
//</Desc>

Hot Spots: all 7 items