Passed
Push — master ( 4cb748...589c2a )
by P.R.
01:36
created

sdoc.command.SDocCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 66.67 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 15
dl 16
loc 24
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A SDocCommand._handle() 9 9 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.helpers import argument
2
3 1
from sdoc.command.BaseCommand import BaseCommand
4 1
from sdoc.io.SDocIO import SDocIO
5 1
from sdoc.SDoc import SDoc
6
7
8 1 View Code Duplication
class SDocCommand(BaseCommand):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9 1
    name = 'sdoc'
10 1
    description = 'Generates the target document(s)'
11 1
    arguments = [argument('config.cfg', description='The name of the config file'),
12
                 argument('main.sdoc', description='The SDoc file')]
13
14
    # ------------------------------------------------------------------------------------------------------------------
15 1
    def _handle(self):
16
        """
17
        Reads the arguments and starts SDoc application.
18
        """
19 1
        sdoc = SDoc()
20 1
        sdoc.io = SDocIO(self.io.input, self.io.output, self.io.error_output)
21 1
        sdoc.config_path = self.argument('config.cfg')
22
23 1
        return sdoc.run_sdoc(self.argument('main.sdoc'))
24
25
# ----------------------------------------------------------------------------------------------------------------------
26