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

oval_graph.command_line_client.client_json_input   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 38
ccs 18
cts 20
cp 0.9
rs 10
c 0
b 0
f 0
wmc 7

5 Methods

Rating   Name   Duplication   Size   Complexity  
A ClientJsonInput.__init__() 0 3 1
A ClientJsonInput.get_only_fail_rule() 0 6 1
A ClientJsonInput._get_rows_of_unselected_rules() 0 5 1
A ClientJsonInput.search_rules_id() 0 5 1
A ClientJsonInput.get_json_data_file() 0 8 3
1 1
import json
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3 1
from .client import Client
4
5
6 1
class ClientJsonInput(Client):
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.json_data_file = self.get_json_data_file()
10
11 1
    def get_only_fail_rule(self, rules):
12
        """
13
        Function processes array of matched IDs of rules in selected file.
14
        Function retunes array of failed matched IDs of rules in selected file.
15
        """
16
        raise NotImplementedError
17
18 1
    def _get_rows_of_unselected_rules(self):
19
        """
20
        Function retunes array of rows where is not selected IDs of rules in selected file.
21
        """
22
        raise NotImplementedError
23
24 1
    def get_json_data_file(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
25 1
        with open(self.source_filename, 'r') as file_:
26 1
            try:
27 1
                return json.load(file_)
28 1
            except Exception:
29 1
                raise ValueError(
0 ignored issues
show
introduced by
Consider explicitly re-raising using the 'from' keyword
Loading history...
30
                    'Used file "{}" is not valid json.'.format(
31
                        self.source_filename))
32
33 1
    def search_rules_id(self):
34 1
        rules = self._get_wanted_rules(
35
            self.json_data_file.keys())
36 1
        notselected_rules = []
37
        return self._check_rules_id(rules, notselected_rules)
38