Total Complexity | 7 |
Total Lines | 93 |
Duplicated Lines | 100 % |
Changes | 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 |
||
17 | View Code Duplication | class GetExistingPdfLabelsResponse implements PaazlResultInterface |
|
|
|||
18 | { |
||
19 | /** |
||
20 | * @var errorType |
||
21 | */ |
||
22 | protected $error = null; |
||
23 | |||
24 | /** |
||
25 | * @var base64Binary |
||
26 | */ |
||
27 | protected $labels = null; |
||
28 | |||
29 | /** |
||
30 | * @var labelMetaDataType |
||
31 | */ |
||
32 | protected $metaData = null; |
||
33 | |||
34 | /** |
||
35 | * Constructor. |
||
36 | * |
||
37 | * @var errorType |
||
38 | * @var base64Binary $labels |
||
39 | * @var labelMetaDataType $metaData |
||
40 | * |
||
41 | * @param mixed $error |
||
42 | * @param mixed $labels |
||
43 | * @param mixed $metaData |
||
44 | */ |
||
45 | public function __construct($error, $labels, $metaData) |
||
46 | { |
||
47 | $this->error = $error; |
||
48 | $this->labels = $labels; |
||
49 | $this->metaData = $metaData; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return errorType |
||
54 | */ |
||
55 | public function getError() |
||
56 | { |
||
57 | return $this->error; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @param errorType $error |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | public function setError($error) |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return base64Binary |
||
74 | */ |
||
75 | public function getLabels() |
||
76 | { |
||
77 | return $this->labels; |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * @param base64Binary $labels |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function setLabels($labels) |
||
86 | { |
||
87 | $this->labels = $labels; |
||
88 | |||
89 | return $this; |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * @return labelMetaDataType |
||
94 | */ |
||
95 | public function getMetaData() |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * @param labelMetaDataType $metaData |
||
102 | * |
||
103 | * @return $this |
||
104 | */ |
||
105 | public function setMetaData($metaData) |
||
110 | } |
||
111 | } |
||
112 |
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.