Passed
Push — master ( 6428d5...bc0e9d )
by Matěj
90:12 queued 26s
created

oval_graph.command_line_client.arf_to_html   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 28
ccs 18
cts 18
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A ArfToHtml.__init__() 0 3 1
A ArfToHtml.create_dict_of_rule() 0 3 1
A ArfToHtml._get_message() 0 4 1
A ArfToHtml._put_to_dict_oval_trees() 0 2 1
A ArfToHtml.prepare_parser() 0 4 1
1 1
from ..converter import Converter
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2 1
from .client_arf_input import ClientArfInput
3 1
from .client_html_output import ClientHtmlOutput
4
5
6 1
class ArfToHtml(ClientArfInput, ClientHtmlOutput):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
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
            'description': 'Client for visualization of SCAP rule evaluation results',
14
            'source_filename': 'ARF scan file',
15
        }
16
17 1
    def create_dict_of_rule(self, rule_id):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
18 1
        converter = Converter(self.arf_xml_parser.get_oval_tree(rule_id))
19 1
        return converter.to_JsTree_dict(self.hide_passing_tests)
20
21 1
    def _put_to_dict_oval_trees(self, dict_oval_trees, rule):
22 1
        dict_oval_trees[rule] = self.create_dict_of_rule(rule)
23
24 1
    def prepare_parser(self, parser):
25 1
        super().prepare_parser(parser)
26 1
        self.prepare_args_when_output_is_html(parser)
27
        self.prepare_args_when_user_can_list_in_rules(parser)
28