Interface IIssuesSet
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
Remarks
This property getter has a constant time complexity.
AllAnnualInterestPercent
Gets ExtensionMethodsDebtUsableInCQLinq.AnnualInterestPercent(Debt, AnnualInterest)(AllDebt,AllAnnualInterest).
double AllAnnualInterestPercent { get; }
Property Value
AllBreakingPoint
Gets ExtensionMethodsDebtUsableInCQLinq.BreakingPoint(Debt, AnnualInterest)(AllDebt,AllAnnualInterest).
TimeSpan AllBreakingPoint { get; }
Property Value
AllDebt
Gets the summed debt of all issues of all rules added through this.Builder.AddRule(IRuleIssues).
Debt AllDebt { get; }
Property Value
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
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
Remarks
This property getter has a constant time complexity.
AllQualityGates
Gets all quality gates through Builder.AddQualityGate(IQualityGate).
IEnumerable<IQualityGate> AllQualityGates { get; }
Property Value
AllRules
Gets all rules added through Builder.AddRule(IRuleIssues).
IEnumerable<IRule> AllRules { get; }
Property Value
AllSuppressedIssues
Gets all issues of all rules suppressed through the usage of SuppressMessageAttribute.
IEnumerable<IIssue> AllSuppressedIssues { get; }
Property Value
- See Also
Builder
Gets the issues-set builder, the only way to modify this issues-set.
IIssuesSetBuilder Builder { get; }
Property Value
CodeBase
Gets the code base on which issues are computed.
ICodeBase CodeBase { get; }
Property Value
DebtFormatter
Gets the debt formatter that is used only in methods relative to debt-rating and debt-ratio.
IDebtFormatter DebtFormatter { get; }
Property Value
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
codeElementICodeElementThe code element.
Returns
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
codeElementdoesn'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
ruleCategorystringThe rule category.
Returns
Remarks
This property getter has a time complexity of O(AllRules.Count()).
AllAnnualInterestPercentIn(ICodeElement)
Gets ExtensionMethodsDebtUsableInCQLinq.AnnualInterestPercent(Debt, AnnualInterest)(AllDebtIn(ICodeElement),AllAnnualInterestIn(ICodeElement)).
double AllAnnualInterestPercentIn(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn'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
ruleCategorystringThe rule category.
Returns
Remarks
This property getter has a time complexity of O(AllRules.Count()).
AllBreakingPointIn(ICodeElement)
Gets ExtensionMethodsDebtUsableInCQLinq.BreakingPoint(Debt, AnnualInterest)(AllDebtIn(ICodeElement),AllAnnualInterestIn(ICodeElement)).
TimeSpan AllBreakingPointIn(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn't belong to CodeBase.
AllBreakingPointIn(string)
TimeSpan AllBreakingPointIn(string ruleCategory)
Parameters
ruleCategorystringThe rule category.
Returns
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
codeElementICodeElementThe code element.
Returns
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
codeElementdoesn't belong to CodeBase.
AllDebtIn(string)
Debt AllDebtIn(string ruleCategory)
Parameters
ruleCategorystringThe rule category.
Returns
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
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn'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
codeElementICodeElementThe code element.
Returns
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
codeElementdoesn't belong to CodeBase.
AnnualInterest(ICodeElement)
Gets the summed annual-interest of all issues relative to codeElement.
AnnualInterest AnnualInterest(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn't belong to CodeBase.
AnnualInterest(IRule)
Gets the summed annual-interest of all issues of rule.
AnnualInterest AnnualInterest(IRule rule)
Parameters
ruleIRuleThe rule on which to get the issues.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if this issue set doesn't contain the
rule.
AnnualInterestPercent(ICodeElement)
Gets ExtensionMethodsDebtUsableInCQLinq.AnnualInterestPercent(Debt, AnnualInterest)(Debt(ICodeElement),AnnualInterest(ICodeElement)).
double AnnualInterestPercent(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn't belong to CodeBase.
AnnualInterestPercent(IRule)
Gets ExtensionMethodsDebtUsableInCQLinq.AnnualInterestPercent(Debt, AnnualInterest)(Debt(IRule),AnnualInterest(IRule)).
double AnnualInterestPercent(IRule rule)
Parameters
ruleIRuleThe rule on which to get the is-violated value.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if this issue set doesn't contain the
rule.
BreakingPoint(ICodeElement)
Gets ExtensionMethodsDebtUsableInCQLinq.BreakingPoint(Debt, AnnualInterest)(Debt(ICodeElement),AnnualInterest(ICodeElement)).
TimeSpan BreakingPoint(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn't belong to CodeBase.
BreakingPoint(IRule)
Gets ExtensionMethodsDebtUsableInCQLinq.BreakingPoint(Debt, AnnualInterest)(Debt(IRule),AnnualInterest(IRule)).
TimeSpan BreakingPoint(IRule rule)
Parameters
ruleIRuleThe rule on which to get the is-violated value.
Returns
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
codeElementICodeElementThe 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
codeElementdoesn'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
codeElementICodeElementThe code element on which we infer the cost to reach
ratingToReach.ratingToReachDebtRatingThe 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
codeElementdoesn't belong to CodeBase.
Debt(ICodeElement)
Gets the summed debt of all issues relative to codeElement.
Debt Debt(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn't belong to CodeBase.
Debt(IRule)
Gets the summed debt of all issues of rule.
Debt Debt(IRule rule)
Parameters
ruleIRuleThe rule on which to get the issues.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if this issue set doesn't contain the
rule.
DebtRating(ICodeElement)
DebtRating? DebtRating(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element on which we infer the rating.
Returns
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
codeElementdoesn'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
codeElementICodeElementThe code element on which we infer the percentage of debt.
Returns
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
codeElementdoesn't belong to CodeBase.
HasAnnualInterest(ICodeElement)
Gets a value indicating whether the codeElement has annual-interest or not.
bool HasAnnualInterest(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
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
codeElementdoesn't belong to CodeBase.
HasDebt(ICodeElement)
Gets a value indicating whether the codeElement has debt or not.
bool HasDebt(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
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
codeElementdoesn't belong to CodeBase.
HasIssue(ICodeElement)
Gets a value indicating whether the codeElement has issues or not.
bool HasIssue(ICodeElement codeElement)
Parameters
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn'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
ruleIRuleThe rule on which to get the is-violated value.
Returns
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
codeElementICodeElementThe code element.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if the
codeElementdoesn't belong to CodeBase.
Issues(IRule)
Gets all issues of rule.
IReadOnlyList<IIssue> Issues(IRule rule)
Parameters
ruleIRuleThe rule on which to get the issues.
Returns
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
ruleIRuleThe rule on which to get the suppressed issues.
Returns
Remarks
This property getter has a constant time complexity.
Exceptions
- ArgumentException
Thrown if this issue set doesn't contain the
rule.