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.

Resource.rsc_id()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
dl 0
loc 7
ccs 0
cts 2
cp 0
crap 2
rs 9.4285
1
"""
2
Enarksh
3
4
Copyright 2013-2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
import abc
9
10
from enarksh.controller.StateChange import StateChange
11
12
13
class Resource(StateChange, metaclass=abc.ABCMeta):
14
    """
15
    Class for objects in the controller of type 'Resource'.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19
    def __init__(self, data):
20
        """
21
        Object constructor.
22
23
        :param dict[str,*] data:
24
        """
25
        StateChange.__init__(self)
26
27
        self._name = str(data['rsc_name'], 'utf-8')  # @todo XXX pystratum
28
        """
29
        The name of this resource.
30
31
        :type: int
32
        """
33
34
        self._rsc_id = data['rsc_id']
35
        """
36
        The ID of this resource.
37
38
        :type: int
39
        """
40
41
    # ------------------------------------------------------------------------------------------------------------------
42
    @property
43
    def name(self):
44
        """
45
        Returns the name of this resource.
46
47
        :rtype: str
48
        """
49
        return self._name
50
51
    # ------------------------------------------------------------------------------------------------------------------
52
    def rsc_id(self):
53
        """
54
        Returns the ID of this resource.
55
56
        :rtype: str
57
        """
58
        return self._rsc_id
59
60
    # ------------------------------------------------------------------------------------------------------------------
61
    @abc.abstractmethod
62
    def acquire(self, *args):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
63
        raise NotImplementedError()
64
65
    # ------------------------------------------------------------------------------------------------------------------
66
    @abc.abstractmethod
67
    def inquire(self, *args):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
68
        raise NotImplementedError()
69
70
    # ------------------------------------------------------------------------------------------------------------------
71
    @abc.abstractmethod
72
    def release(self, *args):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
73
        raise NotImplementedError()
74
75
    # ------------------------------------------------------------------------------------------------------------------
76
    @abc.abstractmethod
77
    def sync_state(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
78
        raise NotImplementedError()
79
80
    # ------------------------------------------------------------------------------------------------------------------
81
    @abc.abstractmethod
82
    def get_type(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
83
        raise NotImplementedError()
84
85
# ----------------------------------------------------------------------------------------------------------------------
86