50 |
not is_running |
not is_running |
51 |
local |
local |
52 |
l_rules_checker: CA_ALL_RULES_CHECKER |
l_rules_checker: CA_ALL_RULES_CHECKER |
53 |
|
l_task: CA_RULE_CHECKING_TASK |
54 |
do |
do |
55 |
is_running := True |
is_running := True |
56 |
-- TODO: caching |
-- TODO: caching |
70 |
end |
end |
71 |
end |
end |
72 |
|
|
73 |
across classes_to_analyze as l_classes loop |
-- TODO: call rule checker |
74 |
|
create l_task.make (l_rules_checker, rules, classes_to_analyze, agent analysis_completed) |
75 |
-- TODO: more elegant and performant solution? |
rota.run_task (l_task) |
|
across rules as l_rules loop |
|
|
l_rules.item.set_checking_class (l_classes.item) |
|
|
-- If rule is non-standard then it will not be checked by l_rules_checker. |
|
|
-- We will have the rule check the current class here: |
|
|
if attached {CA_CFG_RULE} l_rules.item as l_cfg_rule then |
|
|
l_cfg_rule.check_class (l_classes.item) |
|
|
end |
|
|
end |
|
|
|
|
|
l_rules_checker.run_on_class (l_classes.item) |
|
|
|
|
|
rule_violations.extend (create {SORTED_TWO_WAY_LIST[CA_RULE_VIOLATION]}.make, l_classes.item) |
|
|
end |
|
|
|
|
|
across rules as l_rules loop |
|
|
across l_rules.item.violations as l_v loop |
|
|
rule_violations.at (l_v.item.affected_class).extend (l_v.item) |
|
|
end |
|
|
end |
|
|
|
|
|
clear_classes_to_analyze |
|
|
|
|
|
is_running := False |
|
|
completed_actions.call ([True]) |
|
|
completed_actions.wipe_out |
|
|
ensure |
|
|
violation_list_exists: analysis_successful implies rule_violations /= Void |
|
|
not is_running |
|
76 |
end |
end |
77 |
|
|
78 |
clear_classes_to_analyze |
clear_classes_to_analyze |
186 |
|
|
187 |
feature {NONE} -- Implementation |
feature {NONE} -- Implementation |
188 |
|
|
189 |
|
analysis_completed |
190 |
|
do |
191 |
|
across classes_to_analyze as l_classes loop |
192 |
|
rule_violations.extend (create {SORTED_TWO_WAY_LIST[CA_RULE_VIOLATION]}.make, l_classes.item) |
193 |
|
end |
194 |
|
|
195 |
|
across rules as l_rules loop |
196 |
|
across l_rules.item.violations as l_v loop |
197 |
|
rule_violations.at (l_v.item.affected_class).extend (l_v.item) |
198 |
|
end |
199 |
|
end |
200 |
|
|
201 |
|
clear_classes_to_analyze |
202 |
|
|
203 |
|
is_running := False |
204 |
|
completed_actions.call ([True]) |
205 |
|
completed_actions.wipe_out |
206 |
|
end |
207 |
|
|
208 |
settings: CA_SETTINGS |
settings: CA_SETTINGS |
209 |
|
|
210 |
classes_to_analyze: LINKED_SET[CLASS_C] |
classes_to_analyze: LINKED_SET [CLASS_C] |
211 |
|
|
212 |
system_wide_check: BOOLEAN |
system_wide_check: BOOLEAN |
213 |
|
|
214 |
completed_actions: ACTION_SEQUENCE [ TUPLE [BOOLEAN] ] |
completed_actions: ACTION_SEQUENCE [TUPLE [BOOLEAN]] |
215 |
|
|
216 |
|
frozen rota: detachable ROTA_S |
217 |
|
-- Access to rota service |
218 |
|
local |
219 |
|
l_service_consumer: SERVICE_CONSUMER [ROTA_S] |
220 |
|
do |
221 |
|
create l_service_consumer |
222 |
|
if l_service_consumer.is_service_available and then l_service_consumer.service.is_interface_usable then |
223 |
|
Result := l_service_consumer.service |
224 |
|
end |
225 |
|
end |
226 |
|
|
227 |
end |
end |