NDepend.API Documentation
AddRule Method (IIssuesSetDiffBuilder)
NDepend.Issue Namespace > IIssuesSetDiffBuilder Interface : AddRule Method
The rule and issues to add to IssuesSetDiff.NewerIssuesSet.
The rule and issues to add to IssuesSetDiff.OlderIssuesSet.
Add a IRuleIssues.Rule and its IRuleIssues.Issues to both IssuesSetDiff.NewerIssuesSet and IssuesSetDiff.OlderIssuesSet.
Syntax

Parameters

newerRuleIssues
The rule and issues to add to IssuesSetDiff.NewerIssuesSet.
olderRuleIssues
The rule and issues to add to IssuesSetDiff.OlderIssuesSet.
Exceptions
ExceptionDescription
Thrown if IssuesSetDiff.NewerIssuesSet already contains the newerRuleIssues.IRuleIssues.Rule or if IssuesSetDiff.OlderIssuesSet already contains the olderRuleIssues.IRuleIssues.Rule.

Also thrown if an issue of newerRuleIssues.IRuleIssues.Issues have a CodeElement that doesn't belong to IssuesSetDiff.NewerIssuesSet.CodeBase or if an issue of olderRuleIssues.IRuleIssues.Issues have a CodeElement that doesn't belong to IssuesSetDiff.OlderIssuesSet.CodeBase.
Remarks
newerRuleIssues and olderRuleIssues are then compared in the IssuesSetDiff.
A IRuleIssues object can be obtained from NDepend.CodeQuery.ExtensionMethodsQuery.GetIssues.
When a rule is added or removed this.IssuesSetDiff.OlderIssuesSet and NewerIssuesSet, IIssuesSet.AllQualityGates are not recomputed. Hence the quality gates that rely on issues or debt might have a dirty state.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

IIssuesSetDiffBuilder Interface
IIssuesSetDiffBuilder Members