Percentage Debt
% Debt = estimated time to fix all issues (Debt) over estimated total effort to develop the code base, inferred from # lines of code and the Estimated number of man-day to develop 1000 logical lines of code setting in Project Properties > Issue and Debt.
Fails above 30%, warns above 20%. Debt documentation: https://www.ndepend.com/docs/technical-debt#Debt
Fails above 30%, warns above 20%. Debt documentation: https://www.ndepend.com/docs/technical-debt#Debt
CQLinq source
This quality gate 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.
// <QualityGate Name="Percentage Debt" Unit="%" />
failif value > 30%
warnif value > 20%
// Effort to develop the application code only: test code (the TestCode view) is not counted
let timeToDev = TimeSpan.FromMinutes(Application.Assemblies.Sum(a => (a.EffortToDevelop() ?? TimeSpan.Zero).TotalMinutes))
let debt = Issues.Sum(i => i.Debt)
select 100d * debt.ToManDay() / timeToDev.ToManDay()
// <Desc>
// % Debt = estimated time to fix all issues (Debt) over estimated total
// effort to develop the code base, inferred from # lines of code and the
// *Estimated number of man-day to develop 1000 logical lines of code*
// setting in Project Properties > Issue and Debt.
//
// Fails above 30%, warns above 20%.
// Debt documentation: https://www.ndepend.com/docs/technical-debt#Debt
// </Desc>
Open in the interactive Rules Explorer · All default rules
Quality Gates: all 19 items
- Quality Gates Evolution
- Percentage Coverage
- Percentage Coverage on New Code
- Percentage Coverage on Refactored Code
- Percentage Coverage (JustMyCode)
- Percentage Coverage on New Code (JustMyCode)
- Percentage Coverage on Refactored Code (JustMyCode)
- Blocker Issues
- Critical Issues
- New Blocker / Critical / High Issues
- Critical Rules Violated
- Treat Compiler Warnings as Error
- Percentage Debt
- Debt
- New Debt since Baseline
- Debt Rating per Namespace
- Annual Interest
- New Annual Interest since Baseline
- Unnecessary NDepend SuppressMessageAttribute Usage