Passed
Push — master ( ba6342...71f198 )
by P.R.
07:12
created

backuppc_clone.application.BackupPcCloneApplication   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 55
Duplicated Lines 61.82 %

Importance

Changes 0
Metric Value
eloc 31
dl 34
loc 55
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A BackupPcCloneApplication.get_default_commands() 21 21 1
A BackupPcCloneApplication.__init__() 5 5 1

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
"""
2
BackupPC Clone
3
"""
4
from typing import List
5
6
from cleo import Application, Command
7
8
from backuppc_clone.command.AutoCommand import AutoCommand
9
from backuppc_clone.command.BackupCloneCommand import BackupCloneCommand
10
from backuppc_clone.command.BackupDeleteCommand import BackupDeleteCommand
11
from backuppc_clone.command.BackupPreScanCommand import BackupPreScanCommand
12
from backuppc_clone.command.HostDeleteCommand import HostDeleteCommand
13
from backuppc_clone.command.InitCloneCommand import InitCloneCommand
14
from backuppc_clone.command.InitOriginalCommand import InitOriginalCommand
15
from backuppc_clone.command.PoolCommand import PoolCommand
16
from backuppc_clone.command.SyncAuxiliaryCommand import SyncAuxiliaryCommand
17
from backuppc_clone.command.TraversePerformanceTestCommand import TraversePerformanceTestCommand
18
from backuppc_clone.command.VacuumCommand import VacuumCommand
19
20
21 View Code Duplication
class BackupPcCloneApplication(Application):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
22
    """
23
    The BackupPC Clone application.
24
    """
25
26
    # ------------------------------------------------------------------------------------------------------------------
27
    def __init__(self):
28
        """
29
        Object constructor
30
        """
31
        Application.__init__(self, 'backuppc-clone', '1.0.1')
32
33
    # ------------------------------------------------------------------------------------------------------------------
34
    def get_default_commands(self) -> List[Command]:
35
        """
36
        Returns the default commands of this application.
37
38
        :rtype: list[Command]
39
        """
40
        commands = Application.get_default_commands(self)
41
42
        commands.append(AutoCommand())
43
        commands.append(BackupCloneCommand())
44
        commands.append(BackupDeleteCommand())
45
        commands.append(BackupPreScanCommand())
46
        commands.append(HostDeleteCommand())
47
        commands.append(InitCloneCommand())
48
        commands.append(InitOriginalCommand())
49
        commands.append(PoolCommand())
50
        commands.append(SyncAuxiliaryCommand())
51
        commands.append(TraversePerformanceTestCommand())
52
        commands.append(VacuumCommand())
53
54
        return commands
55
56
# ----------------------------------------------------------------------------------------------------------------------
57