Passed
Pull Request — master (#156)
by Jan
04:02
created

oval_graph.command_line_client.client_json_input   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 25
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A ClientJsonInput.__init__() 0 3 1
A ClientJsonInput.get_json_data_file() 0 8 3
A ClientJsonInput.search_rules_id() 0 5 1
1 1
import json
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
import missing from __future__ import absolute_import
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...
Bug introduced by
The method _get_lines_of_wanted_not_selected_rules which was declared abstract in the super-class Client
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method get_only_fail_rule which was declared abstract in the super-class Client
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method prepare_data which was declared abstract in the super-class Client
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
7 1
    def __init__(self, args):
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
8 1
        super().__init__(args)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 8 tabs, expected 2
Loading history...
9 1
        self.json_data_file = self.get_json_data_file()
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 8 tabs, expected 2
Loading history...
10
11 1
    def get_json_data_file(self):
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
introduced by
Missing function or method docstring
Loading history...
12 1
        with open(self.source_filename, 'r') as file_:
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 8 tabs, expected 2
Loading history...
13 1
            try:
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 12 tabs, expected 3
Loading history...
14 1
                return json.load(file_)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 16 tabs, expected 4
Loading history...
15 1
            except Exception:
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 12 tabs, expected 3
Loading history...
16 1
                raise ValueError(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 16 tabs, expected 4
Loading history...
introduced by
Consider explicitly re-raising using the 'from' keyword
Loading history...
17
                    'Used file "{}" is not valid json.'.format(
18
                        self.source_filename))
19
20 1
    def search_rules_id(self):
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 4 tabs, expected 1
Loading history...
21 1
        rules = self._get_wanted_rules_from_array_of_ids(
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 8 tabs, expected 2
Loading history...
22
            self.json_data_file.keys())
23 1
        notselected_rules = []
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 8 tabs, expected 2
Loading history...
24
        return self._check_rules_id(rules, notselected_rules)
0 ignored issues
show
Coding Style introduced by
Bad indentation. Found 8 tabs, expected 2
Loading history...
25