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

sdoc.command.SDoc1Command.SDoc1Command._handle()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 8
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nop 1
crap 1
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 SDoc1Command(BaseCommand):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9 1
    name = 'sdoc1'
10 1
    description = 'Parses a SDoc1 document and generates a SDoc2 document'
11 1
    arguments = [argument('main.sdoc', description='The SDoc1 document to parse'),
12
                 argument('output.sdoc2', description='The generated SDoc document')]
13
14
    # ------------------------------------------------------------------------------------------------------------------
15 1
    def _handle(self) -> int:
16
        """
17
        Reads the arguments and starts SDoc1 application.
18
        """
19 1
        sdoc = SDoc()
20 1
        sdoc.io = SDocIO(self.io.input, self.io.output, self.io.error_output)
21
22 1
        return sdoc.run_sdoc1(self.argument('main.sdoc'), self.argument('output.sdoc2'))
23
24
# ----------------------------------------------------------------------------------------------------------------------
25