Scrobbler.start()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
crap 2
1
from plugin.core.constants import ACTIVITY_MODE
2
from plugin.core.helpers.thread import module
3
from plugin.core.method_manager import MethodManager
4
from plugin.preferences import Preferences
5
from plugin.scrobbler.methods import Logging, WebSocket
6
7
8
@module(start=True, blocking=True)
9
class Scrobbler(object):
10
    methods = MethodManager([
11
        WebSocket,
12
        Logging
13
    ])
14
    started = []
15
16
    @classmethod
17
    def start(cls, blocking=False):
0 ignored issues
show
Unused Code introduced by
The argument blocking seems to be unused.
Loading history...
18
        enabled = ACTIVITY_MODE.get(Preferences.get('activity.mode'))
19
20
        # Start methods
21
        cls.started = cls.methods.start(enabled)
22