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.
Completed
Push — master ( be813a...3d8811 )
by P.R.
06:43 queued 46s
created

kerapu.boom.AttribuutGroep.AttribuutGroep.test()   A

Complexity

Conditions 3

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 6
nop 2
dl 0
loc 14
ccs 6
cts 6
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
"""
2
Kerapu
3
"""
4 1
from kerapu.lbz.Subtraject import Subtraject
5
6
7 1
class AttribuutGroep:
8
    """
9
    Klasse voor attribuutgroep.
10
    """
11
12
    # ------------------------------------------------------------------------------------------------------------------
13 1
    def __init__(self,
14
                 attribute_groep_id: int,
15
                 aantal_voorwaarden_voor_true: int,
16
                 koppelingen: list):
17
        """
18
        Object constructor.
19
20
        :param int attribute_groep_id: Het ID van deze attribuutgroep.
21
        :param int aantal_voorwaarden_voor_true: Het minimale aantal voorwaarden waaraan moet worden voldaan.
22
        :param list[kerapu.boom.attribuut_groep_koppeling.AttribuutGroepKoppeling.AttribuutGroepKoppeling] koppelingen:
23
               De attribuutgroepkoppelingen.
24
        """
25 1
        self._attribute_groep_id = attribute_groep_id
26
        """
27
        Het ID van deze attribuutgroep.
28
29
        :type: int
30
        """
31
32 1
        self._aantal_voorwaarden_voor_true = aantal_voorwaarden_voor_true
33
        """
34
        Het minimale aantal voorwaarden waaraan moet worden voldaan om deze attribuutgroep te laten vuren.
35
36
        :type: int
37
        """
38
39 1
        self._koppelingen = koppelingen
40 1
        """
41
        De attribuutgroepkoppelingen.
42
43
        :type: list[kerapu.boom.attribuut_groep_koppeling..AttribuutGroepKoppeling.AttribuutGroepKoppeling]
44
        """
45
46
    # ------------------------------------------------------------------------------------------------------------------
47 1
    def test(self, subtraject: Subtraject) -> bool:
48
        """
49
        Test of een subtraject voldoet aan de voorwaarden van deze attribuutgroep.
50
51
        :param Subtraject subtraject: Het subtraject.
52
53
        :rtype: bool
54
        """
55 1
        aantal = 0
56 1
        for koppeling in self._koppelingen:
57 1
            if koppeling.test(subtraject):
58 1
                aantal += 1
59
60 1
        return aantal >= self._aantal_voorwaarden_voor_true
61
62
# ----------------------------------------------------------------------------------------------------------------------
63