Contents > 8 Defining Custom Design Metrics and Rules > 8.3 Definition of Design Rules > 8.3.6 Exempting Approved Rule Violations
8.3.6 Exempting Approved Rule Violations
As described in Section 4.7.2 "Accepting Design Rule Violations", the SDMetrics rule checker uses
tagged values or comments to exempt a particular model element from a
particular rule, so that such an approved violation is no longer
reported. Therefore, the rule checker needs to know which model
element type stores the tagged values or comments in the SDMetrics
metamodel, and how to access their contents.
This information is specified in two attributes of the XML root
element of the metric definition file, for example:
<sdmetrics version="2.1" ruleexemption="taggedvalue"
exemptiontag="tagname" >
...
- ruleexemption specifies the model element type that stores
the tagged values or comments
- exemptiontag is a metric expression that can be evaluated
for the model elements specified by the ruleexemption attribute. This
expression should yield the text to be searched for
occurrences of strings of the form violates_rulename (where
rulename is the name of a design rule). For tagged values,
this should be the tag, for comments, this should be the body text of
the comment.
The above example defines that tagged values are contained in meta
model element "taggedvalue", which has an attribute or metric
"tagname" that stores the tag.
Prev |
Up |
Next |
Section 8.3.5 "Word lists" | Contents | Section 8.4 "Definition of Relation Matrices" |