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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 55
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A AttribuutGroep.__init__() 0 24 1
A AttribuutGroep.test() 0 14 3
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