Passed
Branch test (567fee)
by Alexis
01:21
created

SupportBee.Tickets.create()   B

Complexity

Conditions 5

Size

Total Lines 28
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 24
nop 10
dl 0
loc 28
rs 8.8373
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
from base import *
2
from comments import *
3
from customer_groups import *
4
from divers import *
5
from replies import *
6
from teams import *
7
from tickets import *
8
from users import * 
9
10
class SupportBee:
11
    def __init__(self, token, company_url):
12
        self.BASE_URL = company_url + "{url}?auth_token=" + token
13
14
    @property
15
    def tickets(self):
16
        return Tickets(self)
17
18
    @property
19
    def replies(self):
20
        return Replies(self)
21
22
    @property
23
    def comments(self):
24
        return Comments(self)
25
26
    @property
27
    def teams(self):
28
        return Teams(self)
29
30
    @property
31
    def users(self):
32
        return Users(self)
33
34
    @property
35
    def customers_groups(self):
36
        return CustomerGroups(self)
37
38
    @property
39
    def attachments(self):
40
        return Attachments(self)
41
42
    @property
43
    def labels(self):
44
        return Labels(self)
45
46
    @property
47
    def emails(self):
48
        return Emails(self)
49
50
    @property
51
    def filters(self):
52
        return Filters(self)
53
54
    @property
55
    def snippets(self):
56
        return Snippets(self)
57
58
    @property
59
    def reports(self):
60
        return Reports(self)
61