Table of Contents

Interface IIssuesSet

Namespace
NDepend.Issue
Assembly
NDepend.API.dll

An issues-set hold all data about AllIssues of CodeBase and makes convenient to browse issues, rule and code elements.

public interface IIssuesSet
Extension Methods

Remarks

An issues-set can be created through CreateIssuesSet(ICodeBase, IDebtFormatter) or ComputeIssues(IAnalysisResult).
An issues-set gets filled through methods of IIssuesSetBuilder available through Builder.
An issues-set is not thread-safe. It is safe to call IIssuesSet read-only methods concurrently from several threads but it is not safe to call these methods and IIssuesSetBuilder methods concurrently from several threads, this would provoke corrupted state and exceptions.

Properties (12)

AllAnnualInterest

Gets the summed annual-interest of all issues of all rules added through this.Builder.AddRule(IRuleIssues).

AnnualInterest AllAnnualInterest { get; }

Property Value

AnnualInterest

Remarks

This property getter has a constant time complexity.

AllAnnualInterestPercent

double AllAnnualInterestPercent { get; }

Property Value

double

AllBreakingPoint

TimeSpan AllBreakingPoint { get; }

Property Value

TimeSpan

AllDebt

Gets the summed debt of all issues of all rules added through this.Builder.AddRule(IRuleIssues).

Debt AllDebt { get; }

Property Value

Debt

Remarks

This property getter has a constant time complexity.

AllIssues

Gets all issues of all rules added through this.Builder.AddRule(IRuleIssues).

IEnumerable<IIssue> AllIssues { get; }

Property Value

IEnumerable<IIssue>

Remarks

The returned collection is lazy-computed and it is reset each time a rule is added or removed through this.Builder.

AllIssuesCount

Gets the count all issues of all rules added through this.Builder.AddRule(IRuleIssues).

uint AllIssuesCount { get; }

Property Value

uint

Remarks

This property getter has a constant time complexity.

AllQualityGates

Gets all quality gates through Builder.AddQualityGate(IQualityGate).

IEnumerable<IQualityGate> AllQualityGates { get; }

Property Value

IEnumerable<IQualityGate>

AllRules

Gets all rules added through Builder.AddRule(IRuleIssues).

IEnumerable<IRule> AllRules { get; }

Property Value

IEnumerable<IRule>

AllSuppressedIssues

Gets all issues of all rules suppressed through the usage of SuppressMessageAttribute.

IEnumerable<IIssue> AllSuppressedIssues { get; }

Property Value

IEnumerable<IIssue>
See Also

Builder

Gets the issues-set builder, the only way to modify this issues-set.

IIssuesSetBuilder Builder { get; }

Property Value

IIssuesSetBuilder

CodeBase

Gets the code base on which issues are computed.

ICodeBase CodeBase { get; }

Property Value

ICodeBase

DebtFormatter

Gets the debt formatter that is used only in methods relative to debt-rating and debt-ratio.

IDebtFormatter DebtFormatter { get; }

Property Value

IDebtFormatter

Remarks

Methods relative to debt-rating and debt-ratio that relies on this debt formatter are: DebtRating(ICodeElement), CostToReachRating(ICodeElement, DebtRating), CostToReachBetterRating(ICodeElement), DebtRatio(ICodeElement).

Methods (29)

AllAnnualInterestIn(ICodeElement)

Gets the summed annual-interest of all issues relative to codeElement, and relative to all its children code elements, defined by codeElement.RecursiveChildren, if codeElement is a ICodeElementParent.

AnnualInterest AllAnnualInterestIn(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

AnnualInterest

Remarks

This property getter has a constant time complexity.
If codeElement is a IMethod or a IField, it is not a ICodeElementParent and this method is equivalent to this.AnnualInterest(ICodeElement).

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AllAnnualInterestIn(string)

Gets the summed annual-interest of all issues of all rules with IRule.Category equals to ruleCategory.

AnnualInterest AllAnnualInterestIn(string ruleCategory)

Parameters

ruleCategory string

The rule category.

Returns

AnnualInterest

Remarks

This property getter has a time complexity of O(AllRules.Count()).

AllAnnualInterestPercentIn(ICodeElement)

double AllAnnualInterestPercentIn(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

double

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AllAnnualInterestPercentIn(string)

Gets the annual-interest-percent of all issues of all rules with IRule.Category equals to ruleCategory.

double AllAnnualInterestPercentIn(string ruleCategory)

Parameters

ruleCategory string

The rule category.

Returns

double

Remarks

This property getter has a time complexity of O(AllRules.Count()).

AllBreakingPointIn(ICodeElement)

TimeSpan AllBreakingPointIn(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

TimeSpan

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AllBreakingPointIn(string)

Gets the breaking point of all issues of all rules with IRule.Category equals to ruleCategory.

TimeSpan AllBreakingPointIn(string ruleCategory)

Parameters

ruleCategory string

The rule category.

Returns

TimeSpan

Remarks

This property getter has a time complexity of O(AllRules.Count()).

AllDebtIn(ICodeElement)

Gets the summed debt of all issues relative to codeElement, and relative to all its children code elements, defined by codeElement.RecursiveChildren, if codeElement is a ICodeElementParent.

Debt AllDebtIn(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

Debt

Remarks

This property getter has a constant time complexity.
If codeElement is a IMethod or a IField, it is not a ICodeElementParent and this method is equivalent to this.Debt(ICodeElement).

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AllDebtIn(string)

Gets the summed debt of all issues of all rules with IRule.Category equals to ruleCategory.

Debt AllDebtIn(string ruleCategory)

Parameters

ruleCategory string

The rule category.

Returns

Debt

Remarks

This property getter has a time complexity of O(AllRules.Count()).

AllIssuesCountIn(ICodeElement)

Gets the count of all issues relative to codeElement, and relative to all its children code elements, defined by codeElement.RecursiveChildren, if codeElement is a ICodeElementParent.

uint AllIssuesCountIn(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

uint

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AllIssuesIn(ICodeElement)

Gets all issues relative to codeElement, and relative to all its child code elements, defined by codeElement.RecursiveChildren, if codeElement is a ICodeElementParent.

IEnumerable<IIssue> AllIssuesIn(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

IEnumerable<IIssue>

Remarks

This property getter has a O(codeElement.RecursiveChildren.Count<TSource>(IEnumerable<TSource>)) time complexity.
If codeElement is CodeBase this method is equivalent to this.AllIssues.
If codeElement is a IMethod or a IField, it is not a ICodeElementParent and this method is equivalent to this.Issues(ICodeElement).

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AnnualInterest(ICodeElement)

Gets the summed annual-interest of all issues relative to codeElement.

AnnualInterest AnnualInterest(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

AnnualInterest

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AnnualInterest(IRule)

Gets the summed annual-interest of all issues of rule.

AnnualInterest AnnualInterest(IRule rule)

Parameters

rule IRule

The rule on which to get the issues.

Returns

AnnualInterest

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.

AnnualInterestPercent(ICodeElement)

double AnnualInterestPercent(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

double

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

AnnualInterestPercent(IRule)

double AnnualInterestPercent(IRule rule)

Parameters

rule IRule

The rule on which to get the is-violated value.

Returns

double

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.

BreakingPoint(ICodeElement)

TimeSpan BreakingPoint(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

TimeSpan

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

BreakingPoint(IRule)

TimeSpan BreakingPoint(IRule rule)

Parameters

rule IRule

The rule on which to get the is-violated value.

Returns

TimeSpan

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.

CostToReachBetterRating(ICodeElement)

Returns the estimated cost, to reach a better rating, based on the fact that codeElement has actually a total debt estimated to AllDebtIn(ICodeElement)(codeElement).

Debt? CostToReachBetterRating(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element on which we infer the cost to reach a better rating.

Returns

Debt?

Remarks

Better rating means the rating just better than the actual one.
If code element actual rating is D, better rating is C.
If code element actual rating is B, better rating is A.
If code element actual rating is A, this method returns Debt.Zero.
This method implementation calls this.DebtFormatter.CostToReachBetterRating(Debt, ICodeElement).
This method returns null if this.DebtFormatter.ToDebtRatio(Debt, ICodeElement)(codeElement) returns null.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

CostToReachRating(ICodeElement, DebtRating)

Returns the estimated effort to reach ratingToReach, based on the fact that codeElement has actually a total debt estimated to AllDebtIn(ICodeElement)(codeElement).

Debt? CostToReachRating(ICodeElement codeElement, DebtRating ratingToReach)

Parameters

codeElement ICodeElement

The code element on which we infer the cost to reach ratingToReach.

ratingToReach DebtRating

The rating to reach for codeElement

Returns

Debt?

Remarks

If the actual rating of DebtRating(ICodeElement)(codeElement) is equals or better than ratingToReach, this method returns a zero duration Debt value.
This method implementation calls this.DebtFormatter.CostToReachRating(Debt, ICodeElement, DebtRating).
This method returns null if this.DebtFormatter.ToDebtRatio(Debt, ICodeElement)(codeElement) returns null.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

Debt(ICodeElement)

Gets the summed debt of all issues relative to codeElement.

Debt Debt(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

Debt

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

Debt(IRule)

Gets the summed debt of all issues of rule.

Debt Debt(IRule rule)

Parameters

rule IRule

The rule on which to get the issues.

Returns

Debt

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.

DebtRating(ICodeElement)

Gets the debt rating of codeElement in the range A (very good) to E (very bad).

DebtRating? DebtRating(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element on which we infer the rating.

Returns

DebtRating?

Remarks

The debt to infer the rating is obtained through AllDebtIn(ICodeElement)(codeElement).
This method implementation calls this.DebtFormatter.ToDebtRating(Debt, ICodeElement).
This method returns null if this.DebtFormatter.ToDebtRatio(Debt, ICodeElement)(codeElement) returns null.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

DebtRatio(ICodeElement)

Estimate the ratio of technical debt, measured through AllDebtIn(ICodeElement)(codeElement). This ratio is expressed in percentage, of estimated debt, compared to the estimated time it would take to rewrite codeElement from scratch.

double? DebtRatio(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element on which we infer the percentage of debt.

Returns

double?

Remarks

This method implementation calls this.DebtFormatter.ToDebtRatio(Debt, ICodeElement) and returns null if ToDebtRatio(Debt, ICodeElement) returns null, which happens when the PDB file is not found for the assembly containing codeElement, which means that GetNbLinesOfCode_GuaranteedIfPDBFound(ICodeElement) returns null.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

HasAnnualInterest(ICodeElement)

Gets a value indicating whether the codeElement has annual-interest or not.

bool HasAnnualInterest(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

bool

Remarks

If codeElement has only issues with AnnualInterest.Zero, this getter returns false. This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

HasDebt(ICodeElement)

Gets a value indicating whether the codeElement has debt or not.

bool HasDebt(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

bool

Remarks

If codeElement has only issues with Debt.Zero, this getter returns false. This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

HasIssue(ICodeElement)

Gets a value indicating whether the codeElement has issues or not.

bool HasIssue(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

bool

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

IsViolated(IRule)

Gets a value that indicates if the rule is violated in the context of this issues-set.

bool IsViolated(IRule rule)

Parameters

rule IRule

The rule on which to get the is-violated value.

Returns

bool

Remarks

The returned value is the value of IQueryExecutionSuccessResult.IsARuleViolated of the IQueryExecutionSuccessResult object used when calling the method GetIssues(IRule, IQueryExecutionSuccessResult).
This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.

Issues(ICodeElement)

Gets all issues relative to codeElement.

IEnumerable<IIssue> Issues(ICodeElement codeElement)

Parameters

codeElement ICodeElement

The code element.

Returns

IEnumerable<IIssue>

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if the codeElement doesn't belong to CodeBase.

Issues(IRule)

Gets all issues of rule.

IReadOnlyList<IIssue> Issues(IRule rule)

Parameters

rule IRule

The rule on which to get the issues.

Returns

IReadOnlyList<IIssue>

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.

SuppressedIssues(IRule)

Gets all suppressed issues of rule.

IReadOnlyList<IIssue> SuppressedIssues(IRule rule)

Parameters

rule IRule

The rule on which to get the suppressed issues.

Returns

IReadOnlyList<IIssue>

Remarks

This property getter has a constant time complexity.

Exceptions

ArgumentException

Thrown if this issue set doesn't contain the rule.