Total Complexity | 8 |
Total Lines | 107 |
Duplicated Lines | 100 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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 |
||
14 | View Code Duplication | class ClosedOrderOrderTypeModel |
|
|
|||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $leverage; |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $order; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $ordertype; |
||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $pair; |
||
32 | /** |
||
33 | * @var float |
||
34 | */ |
||
35 | private $price; |
||
36 | /** |
||
37 | * @var float |
||
38 | */ |
||
39 | private $price2; |
||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $type; |
||
44 | |||
45 | /** |
||
46 | * OpenOrderOrderTypeModel constructor. |
||
47 | * |
||
48 | * @param string $leverage |
||
49 | * @param string $order |
||
50 | * @param string $ordertype |
||
51 | * @param string $pair |
||
52 | * @param float $price |
||
53 | * @param float $price2 |
||
54 | * @param string $type |
||
55 | */ |
||
56 | public function __construct($leverage, $order, $ordertype, $pair, $price, $price2, $type) |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getLeverage() |
||
71 | { |
||
72 | return $this->leverage; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getOrder() |
||
79 | { |
||
80 | return $this->order; |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getOrdertype() |
||
87 | { |
||
88 | return $this->ordertype; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getPair() |
||
95 | { |
||
96 | return $this->pair; |
||
97 | } |
||
98 | |||
99 | /** |
||
100 | * @return float |
||
101 | */ |
||
102 | public function getPrice() |
||
103 | { |
||
104 | return $this->price; |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * @return float |
||
109 | */ |
||
110 | public function getPrice2() |
||
113 | } |
||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getType() |
||
123 |
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.