Completed
Pull Request — master (#40)
by Oleg
01:53
created

SDoc2Command   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from cleo import Command
0 ignored issues
show
Configuration introduced by
The import cleo could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
10
11
from sdoc.SDoc import SDoc
12
from sdoc.style.SdocStyle import SdocStyle
0 ignored issues
show
Bug introduced by
The name style does not seem to exist in module sdoc.
Loading history...
Configuration introduced by
The import sdoc.style.SdocStyle could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
13
14
15
class SDoc2Command(Command):
0 ignored issues
show
Coding Style introduced by
This class has no __init__ method.
Loading history...
16
    """
17
    This command starts executing sdoc2 component.
18
    """
19
20
    name = 'sdoc2'
21
22
    arguments = [
23
        {
24
            'name': 'main_sdoc_file',
25
            'description': "The 'sdoc' file which we want to parse",
26
            'required': True
27
        }
28
    ]
29
30
    # ------------------------------------------------------------------------------------------------------------------
31
    def handle(self):
32
        """
33
        Reads the arguments and starts SDoc application.
34
        """
35
        self.output = SdocStyle(self.input, self.output)
0 ignored issues
show
Bug introduced by
The Instance of SDoc2Command does not seem to have a member named input.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Coding Style introduced by
The attribute output was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
36
37
        main_sdoc_file = self.argument('main_sdoc_file')
0 ignored issues
show
Bug introduced by
The Instance of SDoc2Command does not seem to have a member named argument.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
38
39
        sdoc = SDoc(self.output)
40
        sdoc.test_sdoc2(main_sdoc_file)
41
42
# ----------------------------------------------------------------------------------------------------------------------
43