Passed
Push — master ( 3a1689...d265e3 )
by Christophe
02:39
created

AdvancedHAxis   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 145
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 145
loc 145
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setShowTextEvery() 6 6 1
A setAllowContainerBoundaryTextCufoff() 6 6 1
A setSlantedText() 6 6 1
A setSlantedTextAngle() 6 6 1
A setMaxAlternation() 6 6 1
A setMaxTextLines() 6 6 1
A setMinTextSpacing() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5 View Code Duplication
class AdvancedHAxis extends MediumHAxis
0 ignored issues
show
Duplication introduced by
This class 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...
6
{
7
    /**
8
     * If false, will hide outermost labels rather than allow them to be cropped by the chart container. If true,
9
     * will allow label cropping.
10
     *
11
     * @var bool
12
     */
13
    protected $allowContainerBoundaryTextCufoff;
14
15
    /**
16
     * If true, draw the horizontal axis text at an angle, to help fit more text along the axis; if false, draw
17
     * horizontal axis text upright. Default behavior is to slant text if it cannot all fit when drawn upright.
18
     * Notice that this option is available only when the hAxis.textPosition is set to 'out' (which is the default).
19
     *
20
     * @var bool
21
     */
22
    protected $slantedText;
23
24
    /**
25
     * The angle of the horizontal axis text, if it's drawn slanted. Ignored if hAxis.slantedText is false, or is in
26
     * auto mode, and the chart decided to draw the text horizontally.
27
     *
28
     * @var int
29
     */
30
    protected $slantedTextAngle;
31
32
    /**
33
     * Maximum number of levels of horizontal axis text. If axis text labels become too crowded, the server might
34
     * shift neighboring labels up or down in order to fit labels closer together. This value specifies the most
35
     * number of levels to use; the server can use fewer levels, if labels can fit without overlapping.
36
     *
37
     * @var int
38
     */
39
    protected $maxAlternation;
40
41
    /**
42
     * Maximum number of lines allowed for the text labels. Labels can span multiple lines if they are too long,
43
     * and the nuber of lines is, by default, limited by the height of the available space.
44
     *
45
     * @var int
46
     */
47
    protected $maxTextLines;
48
49
    /**
50
     * Minimum horizontal spacing, in pixels, allowed between two adjacent text labels. If the labels are spaced too
51
     * densely, or they are too long, the spacing can drop below this threshold, and in this case one of the
52
     * label-unclutter measures will be applied (e.g, truncating the lables or dropping some of them).
53
     *
54
     * @var int
55
     */
56
    protected $minTextSpacing;
57
58
    /**
59
     * How many horizontal axis labels to show, where 1 means show every label, 2 means show every other label,
60
     * and so on. Default is to try to show as many labels as possible without overlapping.
61
     *
62
     * @var int
63
     */
64
    protected $showTextEvery;
65
66
    /**
67
     * @param int $showTextEvery
68
     *
69
     * @return $this
70
     */
71
    public function setShowTextEvery($showTextEvery)
72
    {
73
        $this->showTextEvery = $showTextEvery;
74
75
        return $this;
76
    }
77
78
    /**
79
     * @param bool $allowContainerBoundaryTextCufoff
80
     *
81
     * @return $this
82
     */
83
    public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextCufoff)
84
    {
85
        $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @param bool $slantedText
92
     *
93
     * @return $this
94
     */
95
    public function setSlantedText($slantedText)
96
    {
97
        $this->slantedText = $slantedText;
98
99
        return $this;
100
    }
101
102
    /**
103
     * @param int $slantedTextAngle
104
     *
105
     * @return $this
106
     */
107
    public function setSlantedTextAngle($slantedTextAngle)
108
    {
109
        $this->slantedTextAngle = $slantedTextAngle;
110
111
        return $this;
112
    }
113
114
    /**
115
     * @param int $maxAlternation
116
     *
117
     * @return $this
118
     */
119
    public function setMaxAlternation($maxAlternation)
120
    {
121
        $this->maxAlternation = $maxAlternation;
122
123
        return $this;
124
    }
125
126
    /**
127
     * @param int $maxTextLines
128
     *
129
     * @return $this
130
     */
131
    public function setMaxTextLines($maxTextLines)
132
    {
133
        $this->maxTextLines = $maxTextLines;
134
135
        return $this;
136
    }
137
138
    /**
139
     * @param int $minTextSpacing
140
     *
141
     * @return $this
142
     */
143
    public function setMinTextSpacing($minTextSpacing)
144
    {
145
        $this->minTextSpacing = $minTextSpacing;
146
147
        return $this;
148
    }
149
}
150