Table of Contents

Interface IRule

Namespace
NDepend.Issue
Assembly
NDepend.API.dll

Represents a rule from which IIssue are inferred.

public interface IRule
Extension Methods

Properties (6)

Category

Get the rule category.

string Category { get; }

Property Value

string

Remarks

For a Code query rule, returns the name of the group that contains the rule.
If several groups are involved, returns groups names with " \ " as separator.

ExplicitId

The rule explicit-id like "AvoidTypesTooBig" for example.

string ExplicitId { get; }

Property Value

string

Remarks

If the rule is defined like "ND1000:AvoidTypesTooBig", only explicit-id returned here.
If the rule has no explicit-id, a string empty is returned.

Id

The rule id like "ND1000" for example.

string Id { get; }

Property Value

string

Remarks

If the rule is defined with an explicit-id like "ND1000:AvoidTypesTooBig", the explicit-id is not returned here.
If the rule has no id, a string empty is returned.

IsCritical

Is the rule considered critical or not.

bool IsCritical { get; }

Property Value

bool

Name

The rule name.

string Name { get; }

Property Value

string

Provider

The rule provider.

RuleProvider Provider { get; }

Property Value

RuleProvider

Methods (2)

TryGetDescription(StringFormattingKind, out string)

Try get the rule description if available, formatted according to stringFormattingKind.

bool TryGetDescription(StringFormattingKind stringFormattingKind, out string ruleDescription)

Parameters

stringFormattingKind StringFormattingKind

The formatting of the returned description.

ruleDescription string

The rule description formatted.

Returns

bool

true if the rule description is available.

TryGetHowToFix(StringFormattingKind, out string)

Try get how-to-fix-rule explanation if available, formatted according to stringFormattingKind.

bool TryGetHowToFix(StringFormattingKind stringFormattingKind, out string ruleHowToFix)

Parameters

stringFormattingKind StringFormattingKind

The formatting of the returned how-to-fix-rule explanation.

ruleHowToFix string

The rule how-to-fix-rule explanations formatted.

Returns

bool

true if the how-to-fix-rule explanation is available.