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

Complexity

Total Complexity 11

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 96.3%

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 60
ccs 26
cts 27
cp 0.963
rs 10
c 0
b 0
f 0
wmc 11

5 Functions

Rating   Name   Duplication   Size   Complexity  
A clean_bool() 0 8 3
A clean_date() 0 5 2
A clean_int() 0 5 3
A clean_code() 0 10 1
A clean_str() 0 5 2
1
# ----------------------------------------------------------------------------------------------------------------------
2
from typing import Optional, Any
3
4
LEN_DIAGNOSE_CODE = 4
5 1
LEN_SPECIALISME_CODE = 4
6
LEN_ZORG_ACTIVITEIT_CODE = 6
7 1
LEN_ZORG_INSTELLING_CODE = 8
8 1
LEN_ZORG_PRODUCT_CODE = 9
9 1
LEN_ZORG_PRODUCT_GROEP_CODE = 6
10 1
LEN_ZORG_TYPE_CODE = 2
11 1
LEN_ZORG_VRAAG_CODE = 3
12 1
13 1
14 1
# ----------------------------------------------------------------------------------------------------------------------
15
def clean_bool(x: str) -> bool:
16
    if x == '0':
17
        return False
18 1
19 1
    if x == '1':
20 1
        return True
21
22 1
    raise RuntimeError("Not a boolean value '%s'." % x)
23 1
24
25
# ----------------------------------------------------------------------------------------------------------------------
26
def clean_code(code: str, lengte: int) -> str:
27
    """
28
    Schoont een code van voor- en naloop whitespace en voorziet de code van het juiste aantal voorloop nullen.
29 1
30
    :param str code: De code.
31
    :param int lengte: De gewenste lengte van de code.
32
33
    :rtype: str
34
    """
35
    return code.zfill(lengte)
36
37
38 1
# ----------------------------------------------------------------------------------------------------------------------
39
def clean_date(x: str) -> str:
40
    if x == '':
41
        return '9999-12-31'
42 1
43 1
    return str(x)
44 1
45
46 1
# ----------------------------------------------------------------------------------------------------------------------
47
def clean_int(x: Any, leeg: Optional[int] = None) -> Optional[int]:
48
    if x == '' or not x:
49
        return leeg
50 1
51 1
    return int(x)
52 1
53
54 1
# ----------------------------------------------------------------------------------------------------------------------
55
def clean_str(x: Any) -> Optional[str]:
56
    if x == '':
57
        return None
58 1
59 1
    return str(x)
60 1
61
# ----------------------------------------------------------------------------------------------------------------------
62