Passed
Push — master ( 74faac...3512c9 )
by Daniel
01:17
created

db_extractor.ManageSettings   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A ManageSettings.fn_set_extract_behaviour() 0 13 3
1
2
3
class ManageSettings:
4
5
    @staticmethod
6
    def fn_set_extract_behaviour(in_session):
7
        default_value = 'skip-if-output-file-exists'
8
        allowed_values = [
9
            'skip-if-output-file-exists',
10
            'overwrite-if-output-file-exists',
11
        ]
12
        if ('extract-behaviour' not in in_session) \
13
                or (in_session['extract-behaviour'] not in allowed_values):
14
            value_to_return = default_value
15
        else:
16
            value_to_return = in_session['extract-behaviour']
17
        return value_to_return
18