Debt Rating per Namespace
Forbid namespaces with a poor Debt Rating of E or D.
The Debt Rating derives from the Debt Ratio (% of Debt Amount over estimated effort to develop the code element) and the thresholds in Debt Settings. The effort to develop is inferred from lines of code and the man-days to develop 1000 logical lines of code setting.
The Quality Gate can be modified to match assemblies, types or methods.
The Debt Rating derives from the Debt Ratio (% of Debt Amount over estimated effort to develop the code element) and the thresholds in Debt Settings. The effort to develop is inferred from lines of code and the man-days to develop 1000 logical lines of code setting.
The Quality Gate can be modified to match assemblies, types or methods.
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="Debt Rating per Namespace" Unit="namespaces" />
failif count > 0 namespaces
from n in Application.Namespaces
where n.DebtRating() != null &&
n.DebtRating().Value.EqualsAny(DebtRating.E, DebtRating.D)
select new {
n,
debtRating = n.DebtRating(),
debtRatio = n.DebtRatio(), // % of debt from which DebtRating is inferred
devTimeInManDay = n.EffortToDevelop().ToDebt(),
debtInManDay = n.AllDebt(),
issues = n.AllIssues()
}
// <Desc>
// Forbid namespaces with a poor Debt Rating of **E** or **D**.
//
// The **Debt Rating** derives from the **Debt Ratio** (% of **Debt Amount**
// over **estimated effort to develop the code element**) and the thresholds
// in *Debt Settings*. The effort to develop is inferred from lines of code
// and the *man-days to develop 1000 logical lines of code* setting.
//
// The Quality Gate can be modified to match assemblies, types or methods.
// </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