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.

b2blaze.b2lib.B2.buckets()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 7
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
"""
2
Copyright George Sibble 2018
3
"""
4 1
import os
5 1
from b2blaze.b2_exceptions import B2ApplicationKeyNotSet, B2KeyIDNotSet
6 1
from b2blaze.connector import B2Connector
7 1
from b2blaze.models.bucket_list import B2Buckets
8
9 1
class B2(object):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
10
    """
11
12
    """
13 1
    def __init__(self, key_id=None, application_key=None):
14
        """
15
16
        :param key_id:
17
        :param application_key:
18
        """
19 1
        if key_id is None or application_key is None:
20 1
            key_id = os.environ.get('B2_KEY_ID', None)
21 1
            application_key = os.environ.get('B2_APPLICATION_KEY', None)
22 1
        if key_id is None:
23
            raise B2KeyIDNotSet
24 1
        if application_key is None:
25
            raise B2ApplicationKeyNotSet
26 1
        self.key_id = key_id
27 1
        self.application_key = application_key
28 1
        self.connector = B2Connector(key_id=self.key_id, application_key=self.application_key)
29
30
31 1
    @property
32
    def buckets(self):
33
        """
34
35
        :return:
36
        """
37 1
        return B2Buckets(connector=self.connector)
38
0 ignored issues
show
coding-style introduced by
Trailing newlines
Loading history...
39