Passed
Push — master ( 8ff2fc...2dab2b )
by P.R.
04:18 queued 10s
created

sdoc.application.SDocApplication   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 74.29 %

Test Coverage

Coverage 53.85%

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 26
loc 35
ccs 7
cts 13
cp 0.5385
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A SDocApplication.__init__() 5 5 1
A SDocApplication.get_default_commands() 13 13 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 1
from cleo import Application
2
3 1
from sdoc.command.SDoc1Command import SDoc1Command
4 1
from sdoc.command.SDoc2Command import SDoc2Command
5 1
from sdoc.command.SDocCommand import SDocCommand
6
7
8
# ----------------------------------------------------------------------------------------------------------------------
9 1 View Code Duplication
class SDocApplication(Application):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10
    """
11
    The SDocApplication application.
12
    """
13
14
    # ------------------------------------------------------------------------------------------------------------------
15 1
    def __init__(self):
16
        """
17
        Object constructor.
18
        """
19
        Application.__init__(self, 'SDocApplication', '0.0.11')
20
21
    # ------------------------------------------------------------------------------------------------------------------
22 1
    def get_default_commands(self):
23
        """
24
        Returns the default commands of this application.
25
26
        :rtype: list[cleo.Command]
27
        """
28
        commands = Application.get_default_commands(self)
29
30
        self.add(SDocCommand())
31
        self.add(SDoc1Command())
32
        self.add(SDoc2Command())
33
34
        return commands
35
36
# ----------------------------------------------------------------------------------------------------------------------
37