NDepend.API Documentation
ToDebtRatioString Method
NDepend.TechnicalDebt Namespace > IDebtFormatter Interface : ToDebtRatioString Method
The estimated debt to fix all issues on codeElement
The code element on which we infer the percentage of debt
Gets a string that represents the ratio of technical debt, measured through debt, for codeElement. This ratio is expressed in percentage of estimated debt to fix the debt, compared to the estimated duration it would take to rewrite codeElement from scratch.
Syntax
string ToDebtRatioString( 
   Debt debt,
   ICodeElement codeElement
)

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 the string "N/A" 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
If debt is overflow this method returns the string "overflow".
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