Passed
Push — develop ( 850286...2f2c0e )
by Dean
03:07 queued 32s
created

FastPull   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 50%
Metric Value
dl 0
loc 44
ccs 8
cts 16
cp 0.5
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 4 1
A construct() 0 7 1
A start() 0 10 1
A stop() 0 7 1
1 1
from plugin.sync.core.enums import SyncData, SyncMode
2 1
from plugin.sync.modes.core.base import Mode
3 1
from plugin.sync.modes.fast_pull.lists import LikedLists, PersonalLists, Watchlist
4 1
from plugin.sync.modes.fast_pull.movies import Movies
5 1
from plugin.sync.modes.fast_pull.shows import Shows
6
7 1
import elapsed
8 1
import logging
9
10 1
log = logging.getLogger(__name__)
11
12
13 1
class FastPull(Mode):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14 1
    data = SyncData.All
15 1
    mode = SyncMode.FastPull
16
17 1
    children = [
18
        Movies,
19
        Shows,
20
21
        LikedLists,
22
        PersonalLists,
23
        Watchlist
24
    ]
25
26 1
    @elapsed.clock
27
    def construct(self):
28
        # Start progress tracking
29
        self.current.progress.start()
30
31
        # Construct children
32
        self.execute_children('construct')
33
34 1
    @elapsed.clock
35
    def start(self):
36
        # Fetch changes from trakt.tv
37
        self.trakt.refresh()
38
39
        # Build key table for lookups
40
        self.trakt.build_table()
41
42
        # Start children
43
        self.execute_children('start')
44
45 1
    @elapsed.clock
46
    def run(self):
47
        # Run children
48
        self.execute_children('run')
49
50 1
    @elapsed.clock
51
    def stop(self):
52
        # Stop children
53
        self.execute_children('stop')
54
55
        # Stop progress tracking
56
        self.current.progress.stop()
57