RuleDescriptor RuleDescriptor RuleDescriptor Class

Definition

Describes a rule discovered by the rule engine and supports configuration of its properties. Descriptors inherit properties from RuleConfiguration, to support enabling/disabling the rule during analysis and specifying the severity for problems created by the rule.

This class is not intended to be subclasses by external users - instances of RuleDescriptor are created by the analysis service.

public abstract class RuleDescriptor : Microsoft.SqlServer.Dac.CodeAnalysis.RuleConfiguration
type RuleDescriptor = class
    inherit RuleConfiguration
Public MustInherit Class RuleDescriptor
Inherits RuleConfiguration
Inheritance

Constructors

RuleDescriptor(String) RuleDescriptor(String) RuleDescriptor(String)

Protected constructor to be called by implementing classes.

Properties

DisplayDescription DisplayDescription DisplayDescription

The description of the rule. This should be a short human readable description of what the rule is intended to warn against or block.

This is automatically read from the Metadata property

DisplayName DisplayName DisplayName

Display name describing the rule.

This is automatically read from the Metadata property

Enabled Enabled Enabled

Specifies if the rule is enabled and should be included in the code analysis.

The default value is true

(Inherited from RuleConfiguration)
Metadata Metadata Metadata

The ISqlAnalysisRuleMetadata describing the rule. This is a required property that must be defined by subclasses.

Namespace Namespace Namespace

Gets the namespace for the rule. This is the part of the rule that precedes the final "." in the ID name. For instance for a rule ID "My.Org.MyRuleName", the namespace would be "My.Org".

(Inherited from RuleConfiguration)
Rule Rule Rule

The actual instance of the SqlAnalysisRule

RuleId RuleId RuleId

Gets the unique Id used to identify the rule. This is the fully qualified ID, which would usually be in the form "My.Org.MyRuleName".

(Inherited from RuleConfiguration)
Severity Severity Severity

What severity should problems created by the rule have?

The default severity is Warning

(Inherited from RuleConfiguration)
ShortRuleId ShortRuleId ShortRuleId

Gets the last part of the rule ID. This is the part of the rule that follows the final "." in the ID name. For instance for a rule ID "My.Org.MyRuleName", the short rule ID would be "MyRuleName".

(Inherited from RuleConfiguration)

Applies to