NDepend.API Documentation
AddRule Method (IIssuesSetBuilder)
NDepend.Issue Namespace > IIssuesSetBuilder Interface : AddRule Method
The rule and issues to add.
Add a ruleIssues.IRuleIssues.Rule and its ruleIssues.IRuleIssues.Issues to IssuesSet.
Syntax
void AddRule( 
   IRuleIssues ruleIssues
)

Parameters

ruleIssues
The rule and issues to add.
Exceptions
ExceptionDescription
Thrown if IssuesSet already contains the ruleIssues.IRuleIssues.Rule.
Also thrown if an issue of ruleIssues.IRuleIssues.Issues have a CodeElement that doesn't belong to IssuesSet.CodeBase.
Remarks
A IRuleIssues object can be obtained from NDepend.CodeQuery.ExtensionMethodsQuery.GetIssues.
When a rule is added or removed this.IssuesSet.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

IIssuesSetBuilder Interface
IIssuesSetBuilder Members