Completed
Push — master ( f4e7d7...63b99e )
by Giancarlos
06:02
created

RetentionDetail   A

Complexity

Total Complexity 20

Size/Duplication

Total Lines 268
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 20
c 1
b 0
f 0
lcom 0
cbo 1
dl 268
loc 268
ccs 50
cts 50
cp 1
rs 10

20 Methods

Rating   Name   Duplication   Size   Complexity  
A getTipoDoc() 4 4 1
A setTipoDoc() 5 5 1
A getNumDoc() 4 4 1
A setNumDoc() 5 5 1
A getFechaEmision() 4 4 1
A setFechaEmision() 5 5 1
A getImpTotal() 4 4 1
A setImpTotal() 5 5 1
A getMoneda() 4 4 1
A setMoneda() 5 5 1
A getPagos() 4 4 1
A setPagos() 5 5 1
A getFechaRetencion() 4 4 1
A setFechaRetencion() 5 5 1
A getImpRetenido() 4 4 1
A setImpRetenido() 5 5 1
A getImpPagar() 4 4 1
A setImpPagar() 5 5 1
A getTipoCambio() 4 4 1
A setTipoCambio() 5 5 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
 * Created by PhpStorm.
4
 * User: Administrador
5
 * Date: 08/08/2017
6
 * Time: 10:47 AM
7
 */
8
9
namespace Greenter\Model\Retention;
10
use Greenter\Xml\Validator\RetentionDetailValidator;
11
use Symfony\Component\Validator\Constraints as Assert;
12
13
/**
14
 * Class RetentionDetail
15
 * @package Greenter\Model\Retention
16
 */
17 View Code Duplication
class RetentionDetail
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...
18
{
19
    use RetentionDetailValidator;
20
21
    /**
22
     * Tipo de documento Relacionado.
23
     *
24
     * @Assert\NotBlank()
25
     * @Assert\Length(max="2")
26
     * @var string
27
     */
28
    private $tipoDoc;
29
30
    /**
31
     * Numero del documento relacionado (Serie-Correlativo).
32
     *
33
     * @Assert\NotBlank()
34
     * @Assert\Length(max="13")
35
     * @var string
36
     */
37
    private $numDoc;
38
39
    /**
40
     * Fecha de Emision del documento relacionado.
41
     *
42
     * @Assert\NotBlank()
43
     * @Assert\Date()
44
     * @var \DateTime
45
     */
46
    private $fechaEmision;
47
48
    /**
49
     * Importe total documento Relacionado.
50
     *
51
     * @Assert\NotBlank()
52
     * @var float
53
     */
54
    private $impTotal;
55
56
    /**
57
     * Moneda del docoumento relacionado.
58
     *
59
     * @Assert\NotBlank()
60
     * @Assert\Length(min="3", max="3")
61
     * @var string
62
     */
63
    private $moneda;
64
65
    /**
66
     * Datos del Pago.
67
     *
68
     * @Assert\NotBlank()
69
     * @Assert\Valid()
70
     * @var Payment[]
71
     */
72
    private $pagos;
73
74
    /**
75
     * Fecha de Retención.
76
     *
77
     * @Assert\NotBlank()
78
     * @Assert\Date()
79
     * @var \DateTime
80
     */
81
    private $fechaRetencion;
82
83
    /**
84
     * Importe retenido.
85
     *
86
     * @Assert\NotBlank()
87
     * @var float
88
     */
89
    private $impRetenido;
90
91
    /**
92
     * Importe total a pagar (neto).
93
     *
94
     * @Assert\NotBlank()
95
     * @var float
96
     */
97
    private $impPagar;
98
99
    /**
100
     * @Assert\Valid()
101
     * @var Exchange
102
     */
103
    private $tipoCambio;
104
105
    /**
106
     * @return string
107
     */
108 2
    public function getTipoDoc()
109
    {
110 2
        return $this->tipoDoc;
111
    }
112
113
    /**
114
     * @param string $tipoDoc
115
     * @return RetentionDetail
116
     */
117 4
    public function setTipoDoc($tipoDoc)
118
    {
119 4
        $this->tipoDoc = $tipoDoc;
120 4
        return $this;
121
    }
122
123
    /**
124
     * @return string
125
     */
126 2
    public function getNumDoc()
127
    {
128 2
        return $this->numDoc;
129
    }
130
131
    /**
132
     * @param string $numDoc
133
     * @return RetentionDetail
134
     */
135 4
    public function setNumDoc($numDoc)
136
    {
137 4
        $this->numDoc = $numDoc;
138 4
        return $this;
139
    }
140
141
    /**
142
     * @return \DateTime
143
     */
144 2
    public function getFechaEmision()
145
    {
146 2
        return $this->fechaEmision;
147
    }
148
149
    /**
150
     * @param \DateTime $fechaEmision
151
     * @return RetentionDetail
152
     */
153 4
    public function setFechaEmision($fechaEmision)
154
    {
155 4
        $this->fechaEmision = $fechaEmision;
156 4
        return $this;
157
    }
158
159
    /**
160
     * @return float
161
     */
162 2
    public function getImpTotal()
163
    {
164 2
        return $this->impTotal;
165
    }
166
167
    /**
168
     * @param float $impTotal
169
     * @return RetentionDetail
170
     */
171 4
    public function setImpTotal($impTotal)
172
    {
173 4
        $this->impTotal = $impTotal;
174 4
        return $this;
175
    }
176
177
    /**
178
     * @return string
179
     */
180 2
    public function getMoneda()
181
    {
182 2
        return $this->moneda;
183
    }
184
185
    /**
186
     * @param string $moneda
187
     * @return RetentionDetail
188
     */
189 4
    public function setMoneda($moneda)
190
    {
191 4
        $this->moneda = $moneda;
192 4
        return $this;
193
    }
194
195
    /**
196
     * @return Payment[]
197
     */
198 2
    public function getPagos()
199
    {
200 2
        return $this->pagos;
201
    }
202
203
    /**
204
     * @param Payment[] $pagos
205
     * @return RetentionDetail
206
     */
207 4
    public function setPagos($pagos)
208
    {
209 4
        $this->pagos = $pagos;
210 4
        return $this;
211
    }
212
213
    /**
214
     * @return \DateTime
215
     */
216 2
    public function getFechaRetencion()
217
    {
218 2
        return $this->fechaRetencion;
219
    }
220
221
    /**
222
     * @param \DateTime $fechaRetencion
223
     * @return RetentionDetail
224
     */
225 4
    public function setFechaRetencion($fechaRetencion)
226
    {
227 4
        $this->fechaRetencion = $fechaRetencion;
228 4
        return $this;
229
    }
230
231
    /**
232
     * @return float
233
     */
234 2
    public function getImpRetenido()
235
    {
236 2
        return $this->impRetenido;
237
    }
238
239
    /**
240
     * @param float $impRetenido
241
     * @return RetentionDetail
242
     */
243 4
    public function setImpRetenido($impRetenido)
244
    {
245 4
        $this->impRetenido = $impRetenido;
246 4
        return $this;
247
    }
248
249
    /**
250
     * @return float
251
     */
252 2
    public function getImpPagar()
253
    {
254 2
        return $this->impPagar;
255
    }
256
257
    /**
258
     * @param float $impPagar
259
     * @return RetentionDetail
260
     */
261 4
    public function setImpPagar($impPagar)
262
    {
263 4
        $this->impPagar = $impPagar;
264 4
        return $this;
265
    }
266
267
    /**
268
     * @return Exchange
269
     */
270 2
    public function getTipoCambio()
271
    {
272 2
        return $this->tipoCambio;
273
    }
274
275
    /**
276
     * @param Exchange $tipoCambio
277
     * @return RetentionDetail
278
     */
279 4
    public function setTipoCambio($tipoCambio)
280
    {
281 4
        $this->tipoCambio = $tipoCambio;
282 4
        return $this;
283
    }
284
}