Completed
Push — master ( c37b8d...0e5d6a )
by
unknown
30s queued 12s
created

pypen.drawing.fake_primitives.triangle()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 9
dl 0
loc 3
rs 10
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
2
def rotate(angle):
3
    """Rotates the context"""
4
    raise NotImplementedError("rotate() is not implemented")
5
6
7
def translate(x, y):
8
    """Translates the context by x and y"""
9
    raise NotImplementedError("translate() is not implemented")
10
11
12
def scale(factor):
13
    """Scales the context by the provided factor"""
14
    raise NotImplementedError("scale() is not implemented")
15
16
17
def save():
18
    """Saves the current context's translation, rotation and scaling"""
19
    raise NotImplementedError("save() is not implemented")
20
21
22
def restore():
23
    """Restores the context's translation, rotation and scaling to that of the latest save"""
24
    raise NotImplementedError("restore() is not implemented")
25
26
27
def reset_style():
28
    """Resets PyPen's current setting surrounding style to their default_values, which includes fill_color, stroke_color, stroke_width"""
29
    raise NotImplementedError("reset_style() is not implemented")
30
31
32
def clear_screen():
33
    """Clears the screen"""
34
    raise NotImplementedError("clear_screen() not implemented")
35
36
37
def clear():
38
    """Clears the screen"""
39
    raise NotImplementedError("clear() not implemented")
40
41
42
def fill_screen(color="default_background_color"):
43
    """Fills the screen with the specified color"""
44
    raise NotImplementedError("fill_screen() not implemented")
45
46
47
def fill():
48
    """Fills the current path"""
49
    raise NotImplementedError("fill() not implemented")
50
51
52
def begin_shape():
53
    """Tells PyPen that a shape is a bout to be created"""
54
    raise NotImplementedError("begin_shape() not implemented")
55
56
57
def vertex(x, y):
58
    """Adds a vertex to current shape at (x, y)"""
59
    raise NotImplementedError("vertex() not implemented")
60
61
62
def end_shape(fill_color="", stroke_color="", stroke_width=-1):
63
    """Ends shape and styles it"""
64
    raise NotImplementedError("end_shape() not implemented")
65
66
67
def rectangle(x, y, width, height, fill_color="", stroke_color="", stroke_width=-1):
68
    """Draws a rectangle on the given coordinate with the given width, height and color"""
69
    raise NotImplementedError("rectangle() not implemented")
70
71
72
def circle(x, y, radius, fill_color="", stroke_color="", stroke_width=-1):
73
    """Draws a circle on the given coordinate with the given radius and color"""
74
    raise NotImplementedError("circle() not implemented")
75
76
77
def ellipse(x, y, width, height, fill_color="", stroke_color="", stroke_width=-1):
78
    """Draws an ellipse on the given coordinate with the given width, height and color"""
79
    raise NotImplementedError("ellipse() not implemented")
80
81
82
def arc(x, y, radius, start_angle, stop_angle, fill_color="", stroke_color="", stroke_width=-1):
83
    """Draws an arc on the given coordinate with the given radius, angles and color"""
84
    raise NotImplementedError("arc() not implemented")
85
86
def triangle(x1, y1, x2, y2, x3, y3, fill_color="", stroke_color="", stroke_width=-1):
87
    """Draws a triangle between the supplied coordinates with the given color"""
88
    raise NotImplementedError("triangle() not implemented")
89
90
def line(x1, y1, x2, y2, stroke_color="", stroke_width=-1):
91
    """Draws a line between the supplied coordinates with the given stroke_color and stroke_width"""
92
    raise NotImplementedError("triangle() not implemented")
93