1 |
note |
2 |
description: "Summary description for {CA_RULE}." |
3 |
author: "" |
4 |
date: "$Date$" |
5 |
revision: "$Revision$" |
6 |
|
7 |
deferred class |
8 |
CA_RULE |
9 |
|
10 |
feature -- Activation |
11 |
|
12 |
prepare_checking (a_checker: CA_ALL_RULES_CHECKER) |
13 |
do |
14 |
violations.wipe_out |
15 |
register_actions (a_checker) |
16 |
end |
17 |
|
18 |
feature {NONE} -- Implementation |
19 |
|
20 |
register_actions (a_checker: CA_ALL_RULES_CHECKER) |
21 |
deferred |
22 |
end |
23 |
|
24 |
feature -- formatted rule checking output |
25 |
|
26 |
format_violation_description (a_violation: CA_RULE_VIOLATION; a_formatter: TEXT_FORMATTER) |
27 |
require |
28 |
violation_belongs_to_rule: violations.has (a_violation) |
29 |
deferred |
30 |
end |
31 |
|
32 |
feature -- Basic properties, usually fix |
33 |
|
34 |
title: STRING |
35 |
deferred |
36 |
end |
37 |
|
38 |
description: STRING |
39 |
deferred |
40 |
end |
41 |
|
42 |
options: LINKED_LIST[CA_RULE_OPTION] |
43 |
deferred |
44 |
end |
45 |
|
46 |
is_system_wide: BOOLEAN |
47 |
-- Only check the rule if a system wide analysis is performed. |
48 |
deferred |
49 |
end |
50 |
|
51 |
feature -- Properties the user can change |
52 |
|
53 |
is_enabled: BOOLEAN |
54 |
|
55 |
enable |
56 |
do |
57 |
is_enabled := True |
58 |
ensure |
59 |
is_enabled |
60 |
end |
61 |
|
62 |
disable |
63 |
do |
64 |
is_enabled := False |
65 |
ensure |
66 |
not is_enabled |
67 |
end |
68 |
|
69 |
severity: CA_RULE_SEVERITY |
70 |
|
71 |
set_severity (a_severity: CA_RULE_SEVERITY) |
72 |
do |
73 |
severity := a_severity |
74 |
end |
75 |
|
76 |
feature -- Rule checking |
77 |
|
78 |
set_checking_class (a_class: CLASS_C) |
79 |
do |
80 |
checking_class := a_class |
81 |
end |
82 |
|
83 |
checking_class: detachable CLASS_C |
84 |
|
85 |
feature -- Results |
86 |
|
87 |
violations: LINKED_LIST[CA_RULE_VIOLATION] |
88 |
|
89 |
invariant |
90 |
title_set: title.count > 3 |
91 |
end |