NDepend.API Documentation
CodeRuleAttribute Class
NDepend.Attributes Namespace : CodeRuleAttribute Class
This attribute can be used to declare a code rule (or query) in your source code.
[AttributeUsage(AttributeTargets.All, AllowMultiple=true)]
public sealed class CodeRuleAttribute : System.Attribute 
The code rule is a CQLinq or CQL string.
It is extracted automatically from assemblies analyzed at analysis time.
A code rule gathered from a CodeRuleAttribute appears under a group named: "Rules extracted from Source Code".
Under this rule, code rules are grouped under the parent namespaces of code elements tagged by CodeRuleAttribute.
More information at Rules extracted from code
Inheritance Hierarchy



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

See Also


CodeRuleAttribute Members
NDepend.Attributes Namespace
HasAttribute Method
HasAttribute Method
AttributeClassesThatTagMe Property
IsExtractedFromCode Property