GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( 15d04b...75383a )
by P.R.
05:07
created

ShredderCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B handle() 0 25 3
1
"""
2
Kerapu
3
"""
4
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...
5
6
from kerapu.shredder.BoomBestandenShredder import BoomBestandenShredder
7
from kerapu.shredder.ReferentieShredder import ReferentieShredder
8
from kerapu.style.KerapuStyle import KerapuStyle
9
10
11
class ShredderCommand(Command):
0 ignored issues
show
Coding Style introduced by
This class has no __init__ method.
Loading history...
12
    """
13
    Converteert XML-bestanden met groupertabellen naar CSV-bestanden
14
15
    kerapu:shredder
16
        {XML-bestand : XML-bestand met groupertabellen, b.v. BoomBestanden.xml, Referenties.xml}
17
        {folder : Folder waar de CSV-bestanden moeten worden opgeslagen}
18
    """
19
20
    # ------------------------------------------------------------------------------------------------------------------
21
    def handle(self):
22
        """
23
        Executes the command.
24
        """
25
        self.output = KerapuStyle(self.input, self.output)
0 ignored issues
show
Bug introduced by
The Instance of ShredderCommand 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...
26
27
        filename = self.argument('XML-bestand')
0 ignored issues
show
Bug introduced by
The Instance of ShredderCommand 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...
28
        folder = self.argument('folder')
0 ignored issues
show
Bug introduced by
The Instance of ShredderCommand 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...
29
30
        # Lees de eerste gedeelte van het XML-bestand en bepaal type.
31
        kop = open(filename, 'rt').read(1024)
32
33
        if '<InlezenBoomBestanden>' in kop:
34
            shredder = BoomBestandenShredder(self.output, folder)
35
            shredder.shred_xml_file(filename)
36
37
        elif '<InlezenReferenties>' in kop:
38
            shredder = ReferentieShredder(self.output, folder)
39
            shredder.shred_xml_file(filename)
40
41
        else:
42
            raise RuntimeError("Tag <InlezenBoomBestanden> of <InlezenReferenties> niet gevonden in '{}'".
43
                               format(filename))
44
45
        return 0
46
47
# ----------------------------------------------------------------------------------------------------------------------
48