Contents > 8 Defining Custom Design Metrics and Rules > 8.3 Definition of Design Rules

8.3 Definition of Design Rules

SDMetrics' design rules and heuristics (see Section 4.7 "The View 'Rule Checker'") are defined in the metric definition file, making it easy for you to modify existing rules and add new rules of your own.

The SDMetricsML defines a design rule with an XML element like follows:

<rule name="rulename" domain="ruledomain"
      category="rulecategory" severity="ruleseverity" 
      applies_to="ruleapplication" disabled="false|true" 
      inheritable="true/false" > 
  <description>Description of the rule.</description>
  <'rule definition'" />
</rule>
The attributes of the enclosing "rule" tag are: Next is an optional description of the rule, enclosed in description tags. The description will be shown in the measurement catalog (see Section 4.13 "The View 'Catalog'"). Section 8.6 "Writing Descriptions" explains how to write rule descriptions.

Following the rule description is an XML element that defines the check the rule performs. There are a number of procedures to choose from:


8.3.1 Violation
8.3.2 Cycle
8.3.3 Projection for Rules
8.3.4 Valueset for Rules
8.3.5 Word lists
8.3.6 Exempting Approved Rule Violations