ArfToHtml._get_message()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nop 1
crap 1
1 1
from ..oval_tree.converter import Converter
2 1
from .client_arf_input import ClientArfInput
3 1
from .client_html_output import ClientHtmlOutput
4
5
6 1
class ArfToHtml(ClientArfInput, ClientHtmlOutput):
7 1
    def __init__(self, args):
8 1
        super().__init__(args)
9 1
        self.hide_passing_tests = self.arg.hide_passing_tests
10
11 1
    def _get_message(self):
12 1
        return {
13
            'command_name': 'arf-to-graph',
14
            'description': 'Client for visualization of SCAP rule evaluation results',
15
            'source_filename': 'ARF scan file',
16
        }
17
18 1
    def create_dict_of_rule(self, rule_id):
19 1
        oval_tree = self.arf_xml_parser.get_oval_tree(rule_id)
20 1
        converter = Converter(oval_tree)
21 1
        return converter.to_js_tree_dict(self.hide_passing_tests)
22
23 1
    def _put_to_dict_oval_trees(self, dict_oval_trees, rule):
24 1
        dict_oval_trees[rule] = self.create_dict_of_rule(rule)
25
26 1
    def prepare_parser(self, parser):
27 1
        super().prepare_parser(parser)
28 1
        self.prepare_args_when_output_is_html(parser)
29
        self.prepare_args_when_user_can_list_in_rules(parser)
30