Struct Debt
- Namespace
- NDepend.TechnicalDebt
- Assembly
- NDepend.API.dll
Represent the estimated debt an issue. Such estimation represents the technical debt generated by the issue.
public readonly struct Debt : IComparable<Debt>
- Implements
- Inherited Members
- Extension Methods
Remarks
The raw value of a debt estimation is based on a time-span.
An object of type IDebtFormatter can be used to fomat the debt estimation into man-days, man-months, money or ratio or rate.
In CQLinq code rule, debt values are obtained by casting explicitly a TimeSpan value to a Debt value,
or by naming a TimeSpan column Debt (in which case TimeSpan values are automatically converted to Debt values.
Also such debt value obtained in a CQLinq rule context is multipied by the DebtSettings.DebtFactor.
Constructor (1)
Debt(TimeSpan)
Build a Debt value, based on the time-span value.
public Debt(TimeSpan value)
Parameters
valueTimeSpanThe estimated debt an issue
Field (1)
Zero
Debt with zero value.
public static readonly Debt Zero
Field Value
Properties (4)
IsNegativeOverflow
Returns true if the internal ticks value of this debt value reached the negative maximum autorized by TimeSpan.Ticks.
public bool IsNegativeOverflow { get; }
Property Value
Remarks
Minimum and maximum range for an Debt value is a bit more than [-29 247 years ; +29 247 years].
IsOverflow
Returns true if the internal ticks value of this debt value reached the positive or negative maximum autorized by TimeSpan.Ticks.
public bool IsOverflow { get; }
Property Value
Remarks
Minimum and maximum range for an Debt value is a bit more than [-29 247 years ; +29 247 years].
IsPositiveOverflow
Returns true if the internal ticks value of this debt value reached the positive maximum autorized by TimeSpan.Ticks.
public bool IsPositiveOverflow { get; }
Property Value
Remarks
Minimum and maximum range for an Debt value is a bit more than [-29 247 years ; +29 247 years].
Value
Get the raw time-span value of this estimated debt value.
public TimeSpan Value { get; }
Property Value
Methods (3)
CompareTo(Debt)
Compares the current Debt instance with another Debt object and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(Debt other)
Parameters
otherDebtThe Debt object to compare with the current instance.
Returns
- int
A value less than zero if this instance is less than
other; zero if this instance is equal toother; or a value greater than zero if this instance is greater thanother.
Equals(object)
public override bool Equals(object obj)
Parameters
objobjectThe object to compare to
Returns
GetHashCode()
Returns a hash code for this instance, from this.Value.
public override int GetHashCode()
Returns
Operators (71)
operator +(Debt, Debt)
Add x and y.
public static Debt operator +(Debt x, Debt y)
Parameters
Returns
operator +(Debt, Debt?)
Add x and y. If y is null, returns null.
public static Debt? operator +(Debt x, Debt? y)
Parameters
Returns
- Debt?
operator +(Debt, TimeSpan)
Add debt and timeSpan and returns the result in a Debt value.
public static Debt operator +(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator +(Debt?, Debt)
Add x and y. If x is null, returns null.
public static Debt? operator +(Debt? x, Debt y)
Parameters
Returns
- Debt?
operator +(TimeSpan, Debt)
Add timeSpan and debt and returns the result in a Debt value.
public static Debt operator +(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator /(Debt, double)
Divide x by quotient.
public static Debt operator /(Debt x, double quotient)
Parameters
Returns
Exceptions
- DivideByZeroException
This exception is thrown if quotient is zero.
operator ==(Debt, Debt)
Equality compare debt and y.
public static bool operator ==(Debt debt, Debt y)
Parameters
Returns
operator ==(Debt, TimeSpan)
Equality compare debt and timeSpan.
public static bool operator ==(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator ==(TimeSpan, Debt)
Equality compare debt and timeSpan.
public static bool operator ==(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator >(Debt, Debt)
Returns true if x is strictly higher than y.
public static bool operator >(Debt x, Debt y)
Parameters
Returns
operator >(Debt, Debt?)
Returns true if y is not null and x is strictly higher than y.
public static bool operator >(Debt x, Debt? y)
Parameters
Returns
operator >(Debt, TimeSpan?)
Returns true if timeSpan is not null, and debt is strictly higher than timeSpan.
public static bool operator >(Debt debt, TimeSpan? timeSpan)
Parameters
Returns
operator >(Debt, TimeSpan)
Returns true if debt is strictly higher than timeSpan.
public static bool operator >(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator >(Debt?, Debt)
Returns true if x is not null and strictly higher than y.
public static bool operator >(Debt? x, Debt y)
Parameters
Returns
operator >(Debt?, Debt?)
Returns true if both x and y are not null, and x value is strictly higher than y value.
public static bool operator >(Debt? x, Debt? y)
Parameters
Returns
operator >(Debt?, TimeSpan?)
Returns true if both debt and timeSpan are not null, and debt is strictly higher than timeSpan.
public static bool operator >(Debt? debt, TimeSpan? timeSpan)
Parameters
Returns
operator >(Debt?, TimeSpan)
Returns true if debt is not null and strictly higher than timeSpan.
public static bool operator >(Debt? debt, TimeSpan timeSpan)
Parameters
Returns
operator >(TimeSpan?, Debt)
Returns true if timeSpan is not null, and timeSpan is strictly higher than debt.
public static bool operator >(TimeSpan? timeSpan, Debt debt)
Parameters
Returns
operator >(TimeSpan?, Debt?)
Returns true if both debt and timeSpan are not null, and timeSpan is strictly higher than debt.
public static bool operator >(TimeSpan? timeSpan, Debt? debt)
Parameters
Returns
operator >(TimeSpan, Debt)
Returns true if timeSpan is strictly higher than debt.
public static bool operator >(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator >(TimeSpan, Debt?)
Returns true if debt is not null and timeSpan is strictly higher than debt.
public static bool operator >(TimeSpan timeSpan, Debt? debt)
Parameters
Returns
operator >=(Debt, Debt)
Returns true if x is higher than or equal to y.
public static bool operator >=(Debt x, Debt y)
Parameters
Returns
operator >=(Debt, Debt?)
Returns true if y is not null and x is higher than or equal to y.
public static bool operator >=(Debt x, Debt? y)
Parameters
Returns
operator >=(Debt, TimeSpan?)
Returns true if timeSpan is not null, and debt is higher than or equal to timeSpan.
public static bool operator >=(Debt debt, TimeSpan? timeSpan)
Parameters
Returns
operator >=(Debt, TimeSpan)
Returns true if debt is higher than or equal to timeSpan.
public static bool operator >=(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator >=(Debt?, Debt)
Returns true if x is not null and higher than or equal to y.
public static bool operator >=(Debt? x, Debt y)
Parameters
Returns
operator >=(Debt?, Debt?)
Returns true if both x and y are not null, and x value is higher than or equal to y value.
public static bool operator >=(Debt? x, Debt? y)
Parameters
Returns
operator >=(Debt?, TimeSpan?)
Returns true if both debt and timeSpan are not null, and debt is higher than or equal to timeSpan.
public static bool operator >=(Debt? debt, TimeSpan? timeSpan)
Parameters
Returns
operator >=(Debt?, TimeSpan)
Returns true if debt is not null and higher than or equal to timeSpan.
public static bool operator >=(Debt? debt, TimeSpan timeSpan)
Parameters
Returns
operator >=(TimeSpan?, Debt)
Returns true if timeSpan is not null, and timeSpan is higher than or equal to debt.
public static bool operator >=(TimeSpan? timeSpan, Debt debt)
Parameters
Returns
operator >=(TimeSpan?, Debt?)
Returns true if both debt and timeSpan are not null, and timeSpan is higher than or equal to debt.
public static bool operator >=(TimeSpan? timeSpan, Debt? debt)
Parameters
Returns
operator >=(TimeSpan, Debt)
Returns true if timeSpan is higher than or equal to debt.
public static bool operator >=(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator >=(TimeSpan, Debt?)
Returns true if debt is not null and timeSpan is higher than or equal to debt.
public static bool operator >=(TimeSpan timeSpan, Debt? debt)
Parameters
Returns
implicit operator TimeSpan(Debt)
public static implicit operator TimeSpan(Debt debt)
Parameters
Returns
implicit operator Debt(TimeSpan?)
public static implicit operator Debt(TimeSpan? nullableTimeSpan)
Parameters
Returns
Remarks
implicit operator Debt(TimeSpan)
public static implicit operator Debt(TimeSpan timeSpan)
Parameters
Returns
operator !=(Debt, Debt)
Inequality compare x and y.
public static bool operator !=(Debt x, Debt y)
Parameters
Returns
operator !=(Debt, TimeSpan)
Inequality compare debt and timeSpan.
public static bool operator !=(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator !=(TimeSpan, Debt)
Inequality compare debt and timeSpan.
public static bool operator !=(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator <(Debt, Debt)
Returns true if x is strictly lower than y.
public static bool operator <(Debt x, Debt y)
Parameters
Returns
operator <(Debt, Debt?)
Returns true if y is not null and x is strictly lower than y.
public static bool operator <(Debt x, Debt? y)
Parameters
Returns
operator <(Debt, TimeSpan?)
Returns true if timeSpan is not null, and debt is strictly lower than timeSpan.
public static bool operator <(Debt debt, TimeSpan? timeSpan)
Parameters
Returns
operator <(Debt, TimeSpan)
Returns true if debt is strictly lower than timeSpan.
public static bool operator <(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator <(Debt?, Debt)
Returns true if x is not null and strictly lower than y.
public static bool operator <(Debt? x, Debt y)
Parameters
Returns
operator <(Debt?, Debt?)
Returns true if both x and y are not null, and x value is strictly lower than y value.
public static bool operator <(Debt? x, Debt? y)
Parameters
Returns
operator <(Debt?, TimeSpan?)
Returns true if both debt and timeSpan are not null, and debt is strictly lower than timeSpan.
public static bool operator <(Debt? debt, TimeSpan? timeSpan)
Parameters
Returns
operator <(Debt?, TimeSpan)
Returns true if debt is not null and strictly lower than timeSpan.
public static bool operator <(Debt? debt, TimeSpan timeSpan)
Parameters
Returns
operator <(TimeSpan?, Debt)
Returns true if timeSpan is not null, and timeSpan is strictly lower than debt.
public static bool operator <(TimeSpan? timeSpan, Debt debt)
Parameters
Returns
operator <(TimeSpan?, Debt?)
Returns true if both debt and timeSpan are not null, and timeSpan is strictly lower than debt.
public static bool operator <(TimeSpan? timeSpan, Debt? debt)
Parameters
Returns
operator <(TimeSpan, Debt)
Returns true if timeSpan is strictly lower than debt.
public static bool operator <(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator <(TimeSpan, Debt?)
Returns true if debt is not null and timeSpan is strictly lower than debt.
public static bool operator <(TimeSpan timeSpan, Debt? debt)
Parameters
Returns
operator <=(Debt, Debt)
Returns true if x is lower than or equal to y.
public static bool operator <=(Debt x, Debt y)
Parameters
Returns
operator <=(Debt, Debt?)
Returns true if y is not null and x is lower than or equal to y.
public static bool operator <=(Debt x, Debt? y)
Parameters
Returns
operator <=(Debt, TimeSpan?)
Returns true if timeSpan is not null, and debt is lower than or equal to timeSpan.
public static bool operator <=(Debt debt, TimeSpan? timeSpan)
Parameters
Returns
operator <=(Debt, TimeSpan)
Returns true if debt is lower than or equal to timeSpan.
public static bool operator <=(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator <=(Debt?, Debt)
Returns true if x is not null and lower than or equal to y.
public static bool operator <=(Debt? x, Debt y)
Parameters
Returns
operator <=(Debt?, Debt?)
Returns true if both x and y are not null, and x value is lower than or equal to y value.
public static bool operator <=(Debt? x, Debt? y)
Parameters
Returns
operator <=(Debt?, TimeSpan?)
Returns true if both debt and timeSpan are not null, and debt is lower than or equal to timeSpan.
public static bool operator <=(Debt? debt, TimeSpan? timeSpan)
Parameters
Returns
operator <=(Debt?, TimeSpan)
Returns true if debt is not null and lower than or equal to timeSpan.
public static bool operator <=(Debt? debt, TimeSpan timeSpan)
Parameters
Returns
operator <=(TimeSpan?, Debt)
Returns true if timeSpan is not null, and timeSpan is lower than or equal to debt.
public static bool operator <=(TimeSpan? timeSpan, Debt debt)
Parameters
Returns
operator <=(TimeSpan?, Debt?)
Returns true if both debt and timeSpan are not null, and timeSpan is lower than or equal to debt.
public static bool operator <=(TimeSpan? timeSpan, Debt? debt)
Parameters
Returns
operator <=(TimeSpan, Debt)
Returns true if timeSpan is lower than or equal to debt.
public static bool operator <=(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator <=(TimeSpan, Debt?)
Returns true if debt is not null and timeSpan is lower than or equal to debt.
public static bool operator <=(TimeSpan timeSpan, Debt? debt)
Parameters
Returns
operator *(Debt, double)
Multiply x by factor.
public static Debt operator *(Debt x, double factor)
Parameters
Returns
operator *(double, Debt)
Multiply x by factor.
public static Debt operator *(double factor, Debt x)
Parameters
Returns
operator -(Debt, Debt)
Substract y to x.
public static Debt operator -(Debt x, Debt y)
Parameters
Returns
operator -(Debt, Debt?)
Substract x to y. If y is null, returns null.
public static Debt? operator -(Debt x, Debt? y)
Parameters
Returns
- Debt?
operator -(Debt, TimeSpan)
Substract debt to timeSpan and returns the result in a Debt value.
public static Debt operator -(Debt debt, TimeSpan timeSpan)
Parameters
Returns
operator -(Debt?, Debt)
Substract x to y. If x is null, returns null.
public static Debt? operator -(Debt? x, Debt y)
Parameters
Returns
- Debt?
operator -(TimeSpan, Debt)
Substract timeSpan to debt and returns the result in a Debt value.
public static Debt operator -(TimeSpan timeSpan, Debt debt)
Parameters
Returns
operator -(Debt)
Negate x.
public static Debt operator -(Debt x)
Parameters
xDebtDebt estimation operand to negate.