NDepend.API Documentation
ToDebtRatio Method
NDepend.TechnicalDebt Namespace > IDebtFormatter Interface : ToDebtRatio Method
The estimated debt to fix all issues on codeElement
The code element on which we infer the percentage of debt
Estimate the ratio of technical debt, measured through debt, for codeElement. This ratio is expressed in percentage, of estimated debt, compared to the estimated time it would take to rewrite codeElement from scratch.
Syntax

Parameters

debt
The estimated debt to fix all issues on codeElement
codeElement
The code element on which we infer the percentage of debt

Return Value

The percentage of technical debt or null if the metric NbLinesOfCode is not available for codeElement.
Remarks
This method is obtaining the number of lines of code for codeElement from the method, NDepend.CodeModel.ExtensionMethodsHelpers.NDepend.CodeModel.ExtensionMethodsHelpers.GetNbLinesOfCode_GuaranteedIfPDBFound.
This method returns null, if and only if, NDepend.CodeModel.ExtensionMethodsHelpers.GetNbLinesOfCode_GuaranteedIfPDBFound returns null for codeElement.
To estimate the time it would take to rewrite codeElement from scratch, both DebtSettings values are used:
- DebtSettings.EstimatedNumberOfManDayToDevelop1000LogicalLinesOfCode
- DebtSettings.NumberOfWorkHourPerDay
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

IDebtFormatter Interface
IDebtFormatter Members