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.boom.AttribuutGroep.AttribuutGroep.test()   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 6
nop 2
dl 0
loc 14
ccs 1
cts 1
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
from typing import List
2
3
from kerapu.boom.attribuut_groep_koppeling import AttribuutGroepKoppeling
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[AttribuutGroepKoppeling]):
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: int = attribute_groep_id
26
        """
27
        Het ID van deze attribuutgroep.
28
        """
29
30
        self._aantal_voorwaarden_voor_true: int = aantal_voorwaarden_voor_true
31
        """
32 1
        Het minimale aantal voorwaarden waaraan moet worden voldaan om deze attribuutgroep te laten vuren.
33
        """
34
35
        self._koppelingen: List[AttribuutGroepKoppeling] = koppelingen
36
        """
37
        De attribuutgroepkoppelingen.
38
        """
39 1
40 1
    # ------------------------------------------------------------------------------------------------------------------
41
    def test(self, subtraject: Subtraject) -> bool:
42
        """
43
        Test of een subtraject voldoet aan de voorwaarden van deze attribuutgroep.
44
45
        :param Subtraject subtraject: Het subtraject.
46
47 1
        :rtype: bool
48
        """
49
        aantal = 0
50
        for koppeling in self._koppelingen:
51
            if koppeling.test(subtraject):
52
                aantal += 1
53
54
        return aantal >= self._aantal_voorwaarden_voor_true
55 1
56
# ----------------------------------------------------------------------------------------------------------------------
57