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
Push — master ( 7603ec...aaf73b )
by Raphaël
01:48
created

Reference.__init__()   A

Complexity

Conditions 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
dl 0
loc 11
ccs 4
cts 5
cp 0.8
crap 2.032
rs 9.4285
c 2
b 0
f 0
1 1
from pyjection.helper import get_service_subject_identifier
2
3
4 1
class Reference(object):
5
    """
6
    Base class used when a service needs to register a dependency to another service
7
    """
8
9 1
    def __init__(self, name, return_class=False):
10
        """
11
        :param name: Name of the reference
12
        :type name: str
13
        :param return_class: Whether the reference is on an instance of the other service or a class
14
        :type return_class: bool
15
        """
16 1
        self._name = name
17 1
        if isinstance(name, str) is False:
18
            self._name = get_service_subject_identifier(name)
19 1
        self._return_class = return_class
20
21 1
    @property
22
    def name(self):
23 1
        return self._name
24
25 1
    @property
26
    def return_class(self):
27
        return self._return_class
28