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.
Passed
Branch master (62458d)
by Raphaël
01:07
created

pyjection.helper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 28
rs 10
c 0
b 0
f 0
ccs 10
cts 10
cp 1

2 Functions

Rating   Name   Duplication   Size   Complexity  
A convert_camel_to_snake() 0 10 1
A get_service_subject_identifier() 0 13 2
1 1
import re
2 1
import inspect
3
4 1
def get_service_subject_identifier(service_subject):
5
    """Get the snake_case identifier of the service_subject
6
7
    :param service_subject: Service subject
8
    :type service_subject: mixed
9
    :return: snake case name of the service subject
10
    :rtype: str
11
    """
12 1
    if inspect.isclass(service_subject) is True:
13 1
        subject_name = service_subject.__name__
14
    else:
15 1
        subject_name = service_subject.__class__.__name__
16 1
    return convert_camel_to_snake(subject_name)
17
18 1
def convert_camel_to_snake(value):
19
    """Convert string from CamelCase to snake_case
20
21
    :param value: CamelCase value
22
    :type value: str
23
    :return: snake_case converted value
24
    :rtype: str
25
    """
26
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', value)
27
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()