Class ExtensionMethodsIssue
This static class provides various extension methods related to Issue objects.
public static class ExtensionMethodsIssue
- Inheritance
-
ExtensionMethodsIssue
- Inherited Members
Methods (5)
ComputeSuppressedMessagesOnBaseline(ICompareContext, IDictionary<RuleIdOrCategory, IReadOnlyList<ISuppressMessage>>)
Create a dictionary of suppressed messages indexed by RuleIdOrCategory objects defined on compareContext.OlderCodeBase,
from a similar dictionary defined on compareContext.NewerCodeBase.
public static IDictionary<RuleIdOrCategory, IReadOnlyList<ISuppressMessage>> ComputeSuppressedMessagesOnBaseline(this ICompareContext compareContext, IDictionary<RuleIdOrCategory, IReadOnlyList<ISuppressMessage>> suppressedMessages)
Parameters
compareContextICompareContextThe compare context used to resolve baseline code elements from current code elements.
suppressedMessagesIDictionary<RuleIdOrCategory, IReadOnlyList<ISuppressMessage>>The dictionary of suppressed message indexed by RuleIdOrCategory objects defined on
compareContext.NewerCodeBase.
Returns
Remarks
If a baseline code element is not resolved, the ISuppressMessage objects related to this code element won't be present in the returned dictionary of suppressed messages.
CreateIssuesSet(ICodeBase, IDebtFormatter)
Create an issues-set object dedicated to hold issues on codeBase.
public static IIssuesSet CreateIssuesSet(this ICodeBase codeBase, IDebtFormatter debtFormatter)
Parameters
codeBaseICodeBaseThe code base.
debtFormatterIDebtFormatterDebt rating and debat ratio values obtained through the returned issues-set will be formatted through this debt formatter.
Returns
Remarks
The returned issue set is empty, it doesn't contains any rule nor issue.
An IIssuesSetBuilder instance can be obtained through IIssuesSet.Builder
to fill the returned issues-set with rules and issues.
This overload of the CreateIssuesSet method doesn't take a list of suppressed messages. No issue will be ignored because of the usage of usages of SuppressMessageAttribute in the returned issues-set.
CreateIssuesSetDiff(ICompareContext, IIssuesSet, IIssuesSet)
Create an issues-set-diff object dedicated compare newerIssuesSet and olderIssuesSet
and makes convenient to browse diff information about issues, rule and code elements of these two issues sets.
public static IIssuesSetDiff CreateIssuesSetDiff(this ICompareContext compareContext, IIssuesSet newerIssuesSet, IIssuesSet olderIssuesSet)
Parameters
compareContextICompareContextThe compare context that compares both
newerIssuesSet.CodeBase andolderIssuesSet.CodeBase.newerIssuesSetIIssuesSetThe IIssuesSet object that will play the role of the newer rules and issues snapshot from which to compare.
olderIssuesSetIIssuesSetThe IIssuesSet object that will play the role of the baseline on which to compare rules and issues.
Returns
Remarks
The returned issue-set-diff has already rules and issues of newerIssuesSet and olderIssuesSet compared, if these issues-set are not empty.
An IIssuesSetDiffBuilder instance can be obtained through IIssuesSetDiff.Builder
to fill the both issues-sets with rules and issues.
After calling this methods, newerIssuesSet and olderIssuesSetBuilder must not be called anymore
to changerules and issues of newerIssuesSet and olderIssuesSet, else this will provoque corrupted states and exceptions.
GetExplanation(IIssue)
Get the issue explanation, or string empty if not available.
public static string GetExplanation(this IIssue issue)
Parameters
issueIIssueThe issue on which to get issue explanation.
Returns
GetImage<T>(QualityGateStatus)
Get the image that represents the qualityGateStatus.
public static T GetImage<T>(this QualityGateStatus qualityGateStatus) where T : class
Parameters
qualityGateStatusQualityGateStatusThe quality gate status
Returns
- T
Type Parameters
TSo far the GetImage<T>() parameter type T must be System.Drawing.Image. This requirement might evolve in future version when other UI framework will be supported.