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.

kerapu.shredder.BoomBestandenShredder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 50
dl 0
loc 75
ccs 22
cts 22
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B BoomBestandenShredder.shred_xml_file() 0 63 1
1
from lxml import etree
2
3
from kerapu.shredder.Shredder import Shredder
4 1
5
6 1
class BoomBestandenShredder(Shredder):
7
    """
8
    Klasse voor het schreden en opslaan in CSV-formaat van boombestanden opgeslagen in XML-formaat.
9 1
    """
10
11
    # ------------------------------------------------------------------------------------------------------------------
12
    def shred_xml_file(self, filename: str) -> None:
13
        """
14
        Slaat de boombestanden op in CSV-formaat.
15 1
16
        :param str filename: De filenaam van het XML bestand.
17
        """
18
        self._io.title('Shredder')
19
20
        doc = etree.parse(filename)
21 1
22
        xpath = '/soapenv:Envelope/soapenv:Body/InlezenBoomBestanden/BoomBestanden/'
23 1
        namespaces = {'soapenv': 'http://schemas.xmlsoap.org/soap/envelope/'}
24
25 1
        # Extract beslis regels.
26 1
        table = doc.xpath(xpath + 'BeslisRegels/BeslisRegel', namespaces=namespaces)
27
        fields = ['BeslisRegelId',
28
                  'AttribuutGroepId',
29 1
                  'BeslisRegelTrue',
30 1
                  'BeslisRegelFalse',
31
                  'LabelTrue',
32
                  'LabelFalse',
33
                  'IndicatieAanspraakbeperking',
34
                  'VersieDatum']
35
        self.extract_table(table, 'BeslisRegels.csv', fields, fields)
36
37
        # Extract attribuut groep.
38 1
        table = doc.xpath(xpath + 'AttribuutGroepen/AttribuutGroep', namespaces=namespaces)
39
        fields = ['AttribuutGroepId',
40
                  'AttribuutGroepOmschrijving',
41 1
                  'AantalVoorwaardenVoorTrue',
42 1
                  'VersieDatum']
43
        self.extract_table(table, 'AttribuutGroepen.csv', fields, fields)
44
45
        # Extract attribuut groep koppeling.
46 1
        table = doc.xpath(xpath + 'AttribuutGroepKoppelingen/AttribuutGroepKoppeling', namespaces=namespaces)
47
        fields = ['AttribuutGroepKoppelingId',
48
                  'AttribuutGroepId',
49 1
                  'AttribuutId',
50 1
                  'AttribuutToetsWijze',
51
                  'OnderToetsWaarde',
52
                  'BovenToetsWaarde',
53
                  'VersieDatum']
54
        self.extract_table(table, 'AttribuutGroepKoppelingen.csv', fields, fields)
55
56
        # Extract attributen
57 1
        table = doc.xpath(xpath + 'Attributen/Attribuut', namespaces=namespaces)
58
        fields = ['AttribuutId',
59
                  'AttribuutOmschrijving',
60 1
                  'BoomParameterNummer',
61 1
                  'FilterToetsWijze',
62
                  'FilterWaardeType',
63
                  'OnderFilterWaarde',
64
                  'BovenFilterWaarde',
65
                  'VersieDatum']
66
        self.extract_table(table, 'Attributen.csv', fields, fields)
67
68
        # Extract boomparameters.
69 1
        table = doc.xpath(xpath + 'BoomParameters/BoomParameter', namespaces=namespaces)
70
        fields = ['BoomParameterNummer',
71
                  'Omschrijving',
72 1
                  'TabelNaam',
73 1
                  'VeldNaam']
74
        self.extract_table(table, 'BoomParameters.csv', fields, fields)
75
76
# ----------------------------------------------------------------------------------------------------------------------
77