Table of Contents

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

value TimeSpan

The estimated debt an issue

Field (1)

Zero

Debt with zero value.

public static readonly Debt Zero

Field Value

Debt

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

bool

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

bool

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

bool

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

TimeSpan

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

other Debt

The 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 to other; or a value greater than zero if this instance is greater than other.

Equals(object)

Returns true if obj is a Debt with Value equals to this.Value.

public override bool Equals(object obj)

Parameters

obj object

The object to compare to

Returns

bool

GetHashCode()

Returns a hash code for this instance, from this.Value.

public override int GetHashCode()

Returns

int

Operators (71)

operator +(Debt, Debt)

Add x and y.

public static Debt operator +(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

Debt

operator +(Debt, Debt?)

Add x and y. If y is null, returns null.

public static Debt? operator +(Debt x, Debt? y)

Parameters

x Debt

Debt estimation operand

y Debt?

Nullable debt estimation operand

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

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

Debt

operator +(Debt?, Debt)

Add x and y. If x is null, returns null.

public static Debt? operator +(Debt? x, Debt y)

Parameters

x Debt?

Nullable debt estimation operand

y Debt

Debt estimation operand

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

timeSpan TimeSpan

A TimeSpan value operand

debt Debt

A Debt value operand

Returns

Debt

operator /(Debt, double)

Divide x by quotient.

public static Debt operator /(Debt x, double quotient)

Parameters

x Debt

Debt estimation operand

quotient double

The quotient by which x is divided.

Returns

Debt

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

debt Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

bool

operator ==(Debt, TimeSpan)

Equality compare debt and timeSpan.

public static bool operator ==(Debt debt, TimeSpan timeSpan)

Parameters

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

operator ==(TimeSpan, Debt)

Equality compare debt and timeSpan.

public static bool operator ==(TimeSpan timeSpan, Debt debt)

Parameters

timeSpan TimeSpan

A TimeSpan value operand

debt Debt

A Debt value operand

Returns

bool

operator >(Debt, Debt)

Returns true if x is strictly higher than y.

public static bool operator >(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt

Debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

operator >(Debt, TimeSpan)

Returns true if debt is strictly higher than timeSpan.

public static bool operator >(Debt debt, TimeSpan timeSpan)

Parameters

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

operator >(Debt?, Debt)

Returns true if x is not null and strictly higher than y.

public static bool operator >(Debt? x, Debt y)

Parameters

x Debt?

Nullable debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt?

Nullable debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

operator >(Debt?, TimeSpan)

Returns true if debt is not null and strictly higher than timeSpan.

public static bool operator >(Debt? debt, TimeSpan timeSpan)

Parameters

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt

A nullable Debt value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator >(TimeSpan, Debt)

Returns true if timeSpan is strictly higher than debt.

public static bool operator >(TimeSpan timeSpan, Debt debt)

Parameters

timeSpan TimeSpan

A TimeSpan value operand

debt Debt

A Debt value operand

Returns

bool

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

timeSpan TimeSpan

A TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator >=(Debt, Debt)

Returns true if x is higher than or equal to y.

public static bool operator >=(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt

Debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

operator >=(Debt, TimeSpan)

Returns true if debt is higher than or equal to timeSpan.

public static bool operator >=(Debt debt, TimeSpan timeSpan)

Parameters

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

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

x Debt?

Nullable debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt?

Nullable debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

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

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt

A nullable Debt value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator >=(TimeSpan, Debt)

Returns true if timeSpan is higher than or equal to debt.

public static bool operator >=(TimeSpan timeSpan, Debt debt)

Parameters

timeSpan TimeSpan

Debt estimation operand

debt Debt

Debt estimation operand

Returns

bool

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

timeSpan TimeSpan

A TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

implicit operator TimeSpan(Debt)

A Debt value can be implicitly converted to a TimeSpan value.

public static implicit operator TimeSpan(Debt debt)

Parameters

debt Debt

The Debt value to convert to a TimeSpan value.

Returns

TimeSpan

implicit operator Debt(TimeSpan?)

A nullable TimeSpan value can be implicitly converted to a Debt value.

public static implicit operator Debt(TimeSpan? nullableTimeSpan)

Parameters

nullableTimeSpan TimeSpan?

The nullable TimeSpan value to convert to a Debt value.

Returns

Debt

Remarks

In case of nullnullableTimeSpan, the value Debt.Zero is built.

implicit operator Debt(TimeSpan)

A TimeSpan value can be implicitly converted to a Debt value.

public static implicit operator Debt(TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

The TimeSpan value to convert to a Debt value.

Returns

Debt

operator !=(Debt, Debt)

Inequality compare x and y.

public static bool operator !=(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

bool

operator !=(Debt, TimeSpan)

Inequality compare debt and timeSpan.

public static bool operator !=(Debt debt, TimeSpan timeSpan)

Parameters

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

operator !=(TimeSpan, Debt)

Inequality compare debt and timeSpan.

public static bool operator !=(TimeSpan timeSpan, Debt debt)

Parameters

timeSpan TimeSpan

A TimeSpan value operand

debt Debt

A Debt value operand

Returns

bool

operator <(Debt, Debt)

Returns true if x is strictly lower than y.

public static bool operator <(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt

Debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

operator <(Debt, TimeSpan)

Returns true if debt is strictly lower than timeSpan.

public static bool operator <(Debt debt, TimeSpan timeSpan)

Parameters

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

operator <(Debt?, Debt)

Returns true if x is not null and strictly lower than y.

public static bool operator <(Debt? x, Debt y)

Parameters

x Debt?

Nullable debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt?

Nullable debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

operator <(Debt?, TimeSpan)

Returns true if debt is not null and strictly lower than timeSpan.

public static bool operator <(Debt? debt, TimeSpan timeSpan)

Parameters

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt

A nullable Debt value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator <(TimeSpan, Debt)

Returns true if timeSpan is strictly lower than debt.

public static bool operator <(TimeSpan timeSpan, Debt debt)

Parameters

timeSpan TimeSpan

Debt estimation operand

debt Debt

Debt estimation operand

Returns

bool

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

timeSpan TimeSpan

A TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator <=(Debt, Debt)

Returns true if x is lower than or equal to y.

public static bool operator <=(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt

Debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

operator <=(Debt, TimeSpan)

Returns true if debt is lower than or equal to timeSpan.

public static bool operator <=(Debt debt, TimeSpan timeSpan)

Parameters

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

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

x Debt?

Nullable debt estimation operand

y Debt

Debt estimation operand

Returns

bool

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

x Debt?

Nullable debt estimation operand

y Debt?

Nullable debt estimation operand

Returns

bool

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

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan?

A nullable TimeSpan value operand

Returns

bool

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

debt Debt?

A nullable Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt

A nullable Debt value operand

Returns

bool

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

timeSpan TimeSpan?

A nullable TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator <=(TimeSpan, Debt)

Returns true if timeSpan is lower than or equal to debt.

public static bool operator <=(TimeSpan timeSpan, Debt debt)

Parameters

timeSpan TimeSpan

Debt estimation operand

debt Debt

Debt estimation operand

Returns

bool

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

timeSpan TimeSpan

A TimeSpan value operand

debt Debt?

A nullable Debt value operand

Returns

bool

operator *(Debt, double)

Multiply x by factor.

public static Debt operator *(Debt x, double factor)

Parameters

x Debt

Debt estimation operand

factor double

The factor by which x is multiplied.

Returns

Debt

operator *(double, Debt)

Multiply x by factor.

public static Debt operator *(double factor, Debt x)

Parameters

factor double

The factor by which x is multiplied.

x Debt

Debt estimation operand

Returns

Debt

operator -(Debt, Debt)

Substract y to x.

public static Debt operator -(Debt x, Debt y)

Parameters

x Debt

Debt estimation operand

y Debt

Debt estimation operand

Returns

Debt

operator -(Debt, Debt?)

Substract x to y. If y is null, returns null.

public static Debt? operator -(Debt x, Debt? y)

Parameters

x Debt

Debt estimation operand

y Debt?

Nullable debt estimation operand

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

debt Debt

A Debt value operand

timeSpan TimeSpan

A TimeSpan value operand

Returns

Debt

operator -(Debt?, Debt)

Substract x to y. If x is null, returns null.

public static Debt? operator -(Debt? x, Debt y)

Parameters

x Debt?

Nullable debt estimation operand

y Debt

Debt estimation operand

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

timeSpan TimeSpan

A TimeSpan value operand

debt Debt

A Debt value operand

Returns

Debt

operator -(Debt)

Negate x.

public static Debt operator -(Debt x)

Parameters

x Debt

Debt estimation operand to negate.

Returns

Debt