file_sync_tool.sync.Sync.__init__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 32
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 21
nop 7
dl 0
loc 32
rs 9.376
c 0
b 0
f 0
1
#!/usr/bin/env python3
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
# -*- coding: future_fstrings -*-
3
4
from db_sync_tool.utility import system
5
from db_sync_tool.database import process
6
from file_sync_tool.utility import info, helper
7
from file_sync_tool.transfer import process
0 ignored issues
show
Unused Code introduced by
The import process was already done on line 5. You should be able to
remove this line.
Loading history...
8
9
10
class Sync:
11
    """
12
    Synchronize target files from an origin system
13
    """
14
15
    def __init__(self,
0 ignored issues
show
best-practice introduced by
Too many arguments (7/5)
Loading history...
16
                 config_file=None,
17
                 verbose=False,
18
                 mute=False,
19
                 host_file=None,
20
                 config=None,
21
                 args=None):
22
        """
23
        Initialization
24
        :param config_file:
25
        :param verbose:
26
        :param mute:
27
        :param host_file:
28
        :param config:
29
        :param args:
30
        """
31
        info.print_header(mute)
32
        system.check_args_options(
33
            config_file=config_file,
34
            host_file=host_file,
35
            verbose=verbose,
36
            mute=mute
37
        )
38
        system.get_configuration(config, None)
39
        # workaround for extending config with args
40
        system.config=helper.extend_config(args)
0 ignored issues
show
Coding Style introduced by
Exactly one space required around assignment
Loading history...
41
        helper.adjust_sync_mode()
42
        helper.check_rsync_version()
43
        helper.check_sshpass_version()
44
        helper.check_authorizations()
45
        process.transfer_files()
46
        info.print_footer()
47