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.

ProfileMessage   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
dl 0
loc 15
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 6 3
A __str__() 0 2 1
A decode() 0 4 2
1
from copy import deepcopy
2
3
import time
4
5
from libAnt.message import BroadcastMessage
6
7
8
class ProfileMessage:
9
    def __init__(self, msg, previous):
10
        self.previous = previous
11
        self.msg = deepcopy(msg)
12
        self.count = previous.count + 1 if previous is not None else 1
13
        self.timestamp = time.time()
14
        self.firstTimestamp = previous.firstTimestamp if previous is not None else self.timestamp
15
16
    def __str__(self):
17
        return str(self.msg.deviceNumber)
18
19
    @staticmethod
20
    def decode(cls, msg: BroadcastMessage):
21
        if msg.deviceType in cls.match:
22
            cls.match[msg.deviceType]()