Class ExtensionMethodsDebtUsableInCQLinq
- Namespace
- NDepend.TechnicalDebt
- Assembly
- NDepend.API.dll
This static class provides various extension methods related to Debt objects. These methods are usable in CQLinq expressions.
public static class ExtensionMethodsDebtUsableInCQLinq
- Inheritance
-
ExtensionMethodsDebtUsableInCQLinq
- Inherited Members
Methods (17)
AnnualInterestPercent(Debt, AnnualInterest)
Gets the estimated annual debt interest percent, expressed in percent per year.
public static double AnnualInterestPercent(this Debt debt, AnnualInterest annualInterest)
Parameters
debtDebtThe estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterestThe cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
Remarks
The annual interest percent is equal to 100 multiplied by the annualInterest divided by the debt.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the debt annual interest percent is 20% per year.
Notice that an annual interest percent higher than 100% means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts Debt.Zero value for debt, in which case it returns zero.
If debt is overflow or annualInterest is overflow this method returns 0.
- See Also
AnnualInterestPercent(Debt, AnnualInterest?)
Gets the estimated annual debt interest percent, expressed in percent per year.
public static double? AnnualInterestPercent(this Debt debt, AnnualInterest? annualInterest)
Parameters
debtDebtThe estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterest?The nullable cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
- double?
-
debt.AnnualInterestPercent(annualInterest.Value) ifannualInterestis not null, else returns null.
Remarks
The annual interest percent is equal to 100 multiplied by the annualInterest divided by the debt.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the debt annual interest percent is 20% per year.
Notice that an annual interest percent higher than 100% means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts Debt.Zero value for debt, in which case it returns zero.
- See Also
AnnualInterestPercent(Debt?, AnnualInterest)
Gets the estimated annual debt interest percent, expressed in percent per year.
public static double? AnnualInterestPercent(this Debt? debt, AnnualInterest annualInterest)
Parameters
debtDebt?The nullable estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterestThe cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
- double?
-
debt.Value.AnnualInterestPercent(annualInterest) ifdebtis not null, else returns null.
Remarks
The annual interest percent is equal to 100 multiplied by the annualInterest divided by the debt.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the debt annual interest percent is 20% per year.
Notice that an annual interest percent higher than 100% means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts Debt.Zero value for debt, in which case it returns zero.
- See Also
AnnualInterestPercent(Debt?, AnnualInterest?)
Gets the estimated annual debt interest percent, expressed in percent per year.
public static double? AnnualInterestPercent(this Debt? debt, AnnualInterest? annualInterest)
Parameters
debtDebt?The nullable estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterest?The nullable cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
- double?
-
debt.Value.AnnualInterestPercent(annualInterest.Value) if bothdebtandannualInterestare not null, else returns null.
Remarks
The annual interest percent is equal to 100 multiplied by the annualInterest divided by the debt.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the debt annual interest percent is 20% per year.
Notice that an annual interest percent higher than 100% means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts Debt.Zero value for debt, in which case it returns zero.
- See Also
BreakingPoint(Debt, AnnualInterest)
Gets the time point from now when the estimated cost-to-not-fix the debt will reach the estimated cost-to-fix the debt. This time point is named the breaking point.
public static TimeSpan BreakingPoint(this Debt debt, AnnualInterest annualInterest)
Parameters
debtDebtThe estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterestThe estimated cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
Remarks
The breaking point is the debt divided by the annualInterest.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the breaking point is equal to 5 years from now.
Notice that a breaking point lower than a year means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts AnnualInterest.Zero value for annualInterest, in which case it returns TimeSpan.Zero.
If annualInterest is zero, then this method returns a zero TimeSpan.
If the division leads to a too large value to be handled by TimeSpan, this method will return TimeSpan.MaxValue or TimeSpan.MinValue
depending on the sign of the too large value.
If debt is overflow or annualInterest is overflow this method returns TimeSpan.Zero.
- See Also
BreakingPoint(Debt, AnnualInterest?)
Gets the time point from now when the estimated cost-to-not-fix the debt will reach the estimated cost-to-fix the debt. This time point is named the breaking point.
public static TimeSpan? BreakingPoint(this Debt debt, AnnualInterest? annualInterest)
Parameters
debtDebtThe estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterest?The nullable cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
- TimeSpan?
-
debt.BreakingPoint(annualInterest.Value) ifannualInterestis not null, else returns null.
Remarks
The breaking point is the debt divided by the annualInterest.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the breaking point is equal to 5 years from now.
Notice that a breaking point lower than a year means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts AnnualInterest.Zero value for annualInterest, in which case it returns TimeSpan.Zero.
- See Also
BreakingPoint(Debt?, AnnualInterest)
Gets the time point from now when the estimated cost-to-not-fix the debt will reach the estimated cost-to-fix the debt. This time point is named the breaking point.
public static TimeSpan? BreakingPoint(this Debt? debt, AnnualInterest annualInterest)
Parameters
debtDebt?The nullable estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterestThe cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
- TimeSpan?
-
debt.Value.BreakingPoint(annualInterest) ifdebtis not null, else returns null.
Remarks
The breaking point is the debt divided by the annualInterest.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the breaking point is equal to 5 years from now.
Notice that a breaking point lower than a year means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts AnnualInterest.Zero value for annualInterest, in which case it returns TimeSpan.Zero.
- See Also
BreakingPoint(Debt?, AnnualInterest?)
Gets the time point from now when the estimated cost-to-not-fix the debt will reach the estimated cost-to-fix the debt. This time point is named the breaking point.
public static TimeSpan? BreakingPoint(this Debt? debt, AnnualInterest? annualInterest)
Parameters
debtDebt?The nullable estimated cost-to-fix a set of issues, it can be negative in case of debt-diff value.
annualInterestAnnualInterest?The nullable cost-to-not-fix per year a set of issue, it can be negative in case of annual-interest-diff value.
Returns
- TimeSpan?
-
debt.Value.BreakingPoint(annualInterest.Value) if bothdebtandannualInterestare not null, else returns null.
Remarks
The breaking point is the debt divided by the annualInterest.
For example if the estimated cost-to-fix the debt is equal to 10 man-days, and the estimated cost-to-not-fix the debt is equal to 2 man-days per year
(this is the annualInterest) then the breaking point is equal to 5 years from now.
Notice that a breaking point lower than a year means that during the next 12 monthes, it would be cheaper to fix the debt than not to fix it.
This method accepts AnnualInterest.Zero value for annualInterest, in which case it returns TimeSpan.Zero.
- See Also
Sum(IEnumerable<AnnualInterest>)
Sum the values of all AnnualInterest values in the sequence seq.
public static AnnualInterest Sum(this IEnumerable<AnnualInterest> seq)
Parameters
seqIEnumerable<AnnualInterest>This sequence that contains AnnualInterest values to sum
Returns
Sum(IEnumerable<Debt>)
Sum the values of all Debt values in the sequence seq.
public static Debt Sum(this IEnumerable<Debt> seq)
Parameters
seqIEnumerable<Debt>This sequence that contains Debt values to sum
Returns
Sum<T>(IEnumerable<T>, Func<T, AnnualInterest>)
Sum the values of all AnnualInterest values obtained from elements of the sequence seq through the function projecter.
public static AnnualInterest Sum<T>(this IEnumerable<T> seq, Func<T, AnnualInterest> projecter)
Parameters
seqIEnumerable<T>This sequence that contains objects that are projected to AnnualInterest values to sum, through the function
projecterprojecterFunc<T, AnnualInterest>The function that projects
Tobjects to AnnualInterest values
Returns
Type Parameters
TThe generic type of elements of
seq
Sum<T>(IEnumerable<T>, Func<T, Debt>)
Sum the values of all Debt values obtained from elements of the sequence seq through the function projecter.
public static Debt Sum<T>(this IEnumerable<T> seq, Func<T, Debt> projecter)
Parameters
seqIEnumerable<T>This sequence that contains objects that are projected to Debt values to sum, through the function
projecterprojecterFunc<T, Debt>The function that projects
Tobjects to Debt values
Returns
Type Parameters
TThe generic type of elements of
seq
ToAnnualInterest(TimeSpan?)
Returns an AnnualInterest value from a nullableTimeSpan value.
public static AnnualInterest ToAnnualInterest(this TimeSpan? nullableTimeSpan)
Parameters
Returns
Remarks
if nullableTimeSpan is null, AnnualInterest.Zero is returned.
ToAnnualInterest(TimeSpan)
Returns an AnnualInterest value from a TimeSpan value.
public static AnnualInterest ToAnnualInterest(this TimeSpan timeSpan)
Parameters
Returns
ToChar(DebtRating)
Convert the debtRating to a 'A' 'B' 'C' 'D' 'E' char.
public static char ToChar(this DebtRating debtRating)
Parameters
debtRatingDebtRatingThe DebtRating value.
Returns
ToDebt(TimeSpan?)
public static Debt ToDebt(this TimeSpan? nullableTimeSpan)
Parameters
Returns
Remarks
ToDebt(TimeSpan)
public static Debt ToDebt(this TimeSpan timeSpan)