Conditions | 4 |
Total Lines | 17 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 4 |
Changes | 0 |
1 | 1 | import webbrowser |
|
21 | 1 | def prepare_data(self, rules): |
|
22 | 1 | try: |
|
23 | 1 | out = [] |
|
24 | 1 | rule = None |
|
25 | 1 | out_oval_tree_dict = dict() |
|
26 | 1 | for rule in rules['rules']: |
|
27 | 1 | out_oval_tree_dict[rule] = self.create_dict_of_rule(rule) |
|
28 | 1 | if self.out is not None: |
|
29 | 1 | src = self.get_save_src(rule) |
|
30 | 1 | self.save_dict_as_json(out_oval_tree_dict, src) |
|
31 | 1 | out.append(src) |
|
32 | else: |
||
33 | 1 | print( |
|
34 | str(json.dumps(out_oval_tree_dict, sort_keys=False, indent=4))) |
||
35 | 1 | return out |
|
36 | 1 | except Exception as error: |
|
37 | raise ValueError('Rule: "{}" Error: "{}"'.format(rule, error)) |
||
38 |