Passed
Pull Request — master (#40)
by Jan
04:08
created

command_line   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 57.14 %

Importance

Changes 0
Metric Value
eloc 14
dl 12
loc 21
rs 10
c 0
b 0
f 0
wmc 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A main() 12 12 3

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
import oval_graph.client
2
import sys
3
4
5 View Code Duplication
def main():
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6
    client = oval_graph.client.client(sys.argv[1:])
7
    rules = client.search_rules_id()
8
    if len(rules) > 1:
9
        answers = client.run_gui_and_return_answers()
10
        if answers is None:
11
            print("You haven't got installed PyInquirer lib. "
12
                  "Please copy id rule with you want use and put it in command")
13
        else:
14
            client.prepare_data(answers)
15
    else:
16
        client.prepare_data({'rules': [rules[0]['id_rule']]})
17
18
19
if __name__ == '__main__':
20
    main()
21