BankwireDirectPayIn   B
last analyzed

Complexity

Total Complexity 43

Size/Duplication

Total Lines 384
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 43
c 2
b 0
f 2
lcom 1
cbo 0
dl 0
loc 384
rs 8.3157

43 Methods

Rating   Name   Duplication   Size   Complexity  
A getTag() 0 4 1
A setTag() 0 4 1
A getAuthorId() 0 4 1
A setAuthorId() 0 4 1
A getCreditedWalletId() 0 4 1
A setCreditedWalletId() 0 4 1
A getCreditedUserId() 0 4 1
A setCreditedUserId() 0 4 1
A getDeclaredDebitedFundsCurrency() 0 4 1
A setDeclaredDebitedFundsCurrency() 0 4 1
A getDeclaredDebitedFundsAmount() 0 4 1
A setDeclaredDebitedFundsAmount() 0 4 1
A getDeclaredFeesCurrency() 0 4 1
A setDeclaredFeesCurrency() 0 4 1
A getDeclaredFeesAmount() 0 4 1
A setDeclaredFeesAmount() 0 4 1
A getStatus() 0 4 1
A setStatus() 0 4 1
A getResultCode() 0 4 1
A setResultCode() 0 4 1
A getResultMessage() 0 4 1
A setResultMessage() 0 4 1
A getType() 0 4 1
A setType() 0 4 1
A getNature() 0 4 1
A setNature() 0 4 1
A getPaymentType() 0 4 1
A setPaymentType() 0 4 1
A getExecutionType() 0 4 1
A setExecutionType() 0 4 1
A getWireReference() 0 4 1
A setWireReference() 0 4 1
A getBankAccountType() 0 4 1
A setBankAccountType() 0 4 1
A getBankAccountOwnerName() 0 4 1
A setBankAccountOwnerName() 0 4 1
A getBankAccountIban() 0 4 1
A setBankAccountIban() 0 4 1
A getBankAccountBic() 0 4 1
A setBankAccountBic() 0 4 1
A getResourceId() 0 4 1
A setResourceId() 0 4 1
A getAmount() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like BankwireDirectPayIn often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use BankwireDirectPayIn, and based on these observations, apply Extract Interface, too.

1
<?php
2
/**
3
 * Created by Carl Owens ([email protected])
4
 * Company: PartFire Ltd (www.partfire.co.uk)
5
 * Copyright © 2017 PartFire Ltd. All rights reserved.
6
 *
7
 * User:    Carl Owens
8
 * Date:    19/01/2017
9
 * Time:    15:31
10
 * File:    BankwireDirectPayIn.php
11
 **/
12
13
namespace PartFire\MangoPayBundle\Models\DTOs;
14
15
class BankwireDirectPayIn
16
{
17
    private $resourceId;
18
19
    private $tag;
20
21
    private $authorId;
22
23
    private $creditedWalletId;
24
25
    private $creditedUserId;
26
27
    private $declaredDebitedFundsCurrency;
28
29
    private $declaredDebitedFundsAmount;
30
31
    private $declaredFeesCurrency;
32
33
    private $declaredFeesAmount;
34
35
    private $status;
36
37
    private $resultCode;
38
39
    private $resultMessage;
40
41
    private $type;
42
43
    private $nature;
44
45
    private $paymentType;
46
47
    private $executionType;
48
49
    private $wireReference;
50
51
    private $bankAccountType;
52
53
    private $bankAccountOwnerName;
54
55
    private $bankAccountIban;
56
57
    private $bankAccountBic;
58
59
    public function getAmount()
60
    {
61
        return $this->getDeclaredDebitedFundsAmount();
62
    }
63
    /**
64
     * @return mixed
65
     */
66
    public function getTag()
67
    {
68
        return $this->tag;
69
    }
70
71
    /**
72
     * @param mixed $tag
73
     */
74
    public function setTag($tag)
75
    {
76
        $this->tag = $tag;
77
    }
78
79
    /**
80
     * @return mixed
81
     */
82
    public function getAuthorId()
83
    {
84
        return $this->authorId;
85
    }
86
87
    /**
88
     * @param mixed $authorId
89
     */
90
    public function setAuthorId($authorId)
91
    {
92
        $this->authorId = $authorId;
93
    }
94
95
    /**
96
     * @return mixed
97
     */
98
    public function getCreditedWalletId()
99
    {
100
        return $this->creditedWalletId;
101
    }
102
103
    /**
104
     * @param mixed $creditedWalletId
105
     */
106
    public function setCreditedWalletId($creditedWalletId)
107
    {
108
        $this->creditedWalletId = $creditedWalletId;
109
    }
110
111
    /**
112
     * @return mixed
113
     */
114
    public function getCreditedUserId()
115
    {
116
        return $this->creditedUserId;
117
    }
118
119
    /**
120
     * @param mixed $creditedUserId
121
     */
122
    public function setCreditedUserId($creditedUserId)
123
    {
124
        $this->creditedUserId = $creditedUserId;
125
    }
126
127
    /**
128
     * @return mixed
129
     */
130
    public function getDeclaredDebitedFundsCurrency()
131
    {
132
        return $this->declaredDebitedFundsCurrency;
133
    }
134
135
    /**
136
     * @param mixed $declaredDebitedFundsCurrency
137
     */
138
    public function setDeclaredDebitedFundsCurrency($declaredDebitedFundsCurrency)
139
    {
140
        $this->declaredDebitedFundsCurrency = $declaredDebitedFundsCurrency;
141
    }
142
143
    /**
144
     * @return mixed
145
     */
146
    public function getDeclaredDebitedFundsAmount()
147
    {
148
        return $this->declaredDebitedFundsAmount;
149
    }
150
151
    /**
152
     * @param mixed $declaredDebitedFundsAmount
153
     */
154
    public function setDeclaredDebitedFundsAmount($declaredDebitedFundsAmount)
155
    {
156
        $this->declaredDebitedFundsAmount = $declaredDebitedFundsAmount;
157
    }
158
159
    /**
160
     * @return mixed
161
     */
162
    public function getDeclaredFeesCurrency()
163
    {
164
        return $this->declaredFeesCurrency;
165
    }
166
167
    /**
168
     * @param mixed $declaredFeesCurrency
169
     */
170
    public function setDeclaredFeesCurrency($declaredFeesCurrency)
171
    {
172
        $this->declaredFeesCurrency = $declaredFeesCurrency;
173
    }
174
175
    /**
176
     * @return mixed
177
     */
178
    public function getDeclaredFeesAmount()
179
    {
180
        return $this->declaredFeesAmount;
181
    }
182
183
    /**
184
     * @param mixed $declaredFeesAmount
185
     */
186
    public function setDeclaredFeesAmount($declaredFeesAmount)
187
    {
188
        $this->declaredFeesAmount = $declaredFeesAmount;
189
    }
190
191
    /**
192
     * @return mixed
193
     */
194
    public function getStatus()
195
    {
196
        return $this->status;
197
    }
198
199
    /**
200
     * @param mixed $status
201
     */
202
    public function setStatus($status)
203
    {
204
        $this->status = $status;
205
    }
206
207
    /**
208
     * @return mixed
209
     */
210
    public function getResultCode()
211
    {
212
        return $this->resultCode;
213
    }
214
215
    /**
216
     * @param mixed $resultCode
217
     */
218
    public function setResultCode($resultCode)
219
    {
220
        $this->resultCode = $resultCode;
221
    }
222
223
    /**
224
     * @return mixed
225
     */
226
    public function getResultMessage()
227
    {
228
        return $this->resultMessage;
229
    }
230
231
    /**
232
     * @param mixed $resultMessage
233
     */
234
    public function setResultMessage($resultMessage)
235
    {
236
        $this->resultMessage = $resultMessage;
237
    }
238
239
    /**
240
     * @return mixed
241
     */
242
    public function getType()
243
    {
244
        return $this->type;
245
    }
246
247
    /**
248
     * @param mixed $type
249
     */
250
    public function setType($type)
251
    {
252
        $this->type = $type;
253
    }
254
255
    /**
256
     * @return mixed
257
     */
258
    public function getNature()
259
    {
260
        return $this->nature;
261
    }
262
263
    /**
264
     * @param mixed $nature
265
     */
266
    public function setNature($nature)
267
    {
268
        $this->nature = $nature;
269
    }
270
271
    /**
272
     * @return mixed
273
     */
274
    public function getPaymentType()
275
    {
276
        return $this->paymentType;
277
    }
278
279
    /**
280
     * @param mixed $paymentType
281
     */
282
    public function setPaymentType($paymentType)
283
    {
284
        $this->paymentType = $paymentType;
285
    }
286
287
    /**
288
     * @return mixed
289
     */
290
    public function getExecutionType()
291
    {
292
        return $this->executionType;
293
    }
294
295
    /**
296
     * @param mixed $executionType
297
     */
298
    public function setExecutionType($executionType)
299
    {
300
        $this->executionType = $executionType;
301
    }
302
303
    /**
304
     * @return mixed
305
     */
306
    public function getWireReference()
307
    {
308
        return $this->wireReference;
309
    }
310
311
    /**
312
     * @param mixed $wireReference
313
     */
314
    public function setWireReference($wireReference)
315
    {
316
        $this->wireReference = $wireReference;
317
    }
318
319
    /**
320
     * @return mixed
321
     */
322
    public function getBankAccountType()
323
    {
324
        return $this->bankAccountType;
325
    }
326
327
    /**
328
     * @param mixed $bankAccountType
329
     */
330
    public function setBankAccountType($bankAccountType)
331
    {
332
        $this->bankAccountType = $bankAccountType;
333
    }
334
335
    /**
336
     * @return mixed
337
     */
338
    public function getBankAccountOwnerName()
339
    {
340
        return $this->bankAccountOwnerName;
341
    }
342
343
    /**
344
     * @param mixed $bankAccountOwnerName
345
     */
346
    public function setBankAccountOwnerName($bankAccountOwnerName)
347
    {
348
        $this->bankAccountOwnerName = $bankAccountOwnerName;
349
    }
350
351
    /**
352
     * @return mixed
353
     */
354
    public function getBankAccountIban()
355
    {
356
        return $this->bankAccountIban;
357
    }
358
359
    /**
360
     * @param mixed $bankAccountIban
361
     */
362
    public function setBankAccountIban($bankAccountIban)
363
    {
364
        $this->bankAccountIban = $bankAccountIban;
365
    }
366
367
    /**
368
     * @return mixed
369
     */
370
    public function getBankAccountBic()
371
    {
372
        return $this->bankAccountBic;
373
    }
374
375
    /**
376
     * @param mixed $bankAccountBic
377
     */
378
    public function setBankAccountBic($bankAccountBic)
379
    {
380
        $this->bankAccountBic = $bankAccountBic;
381
    }
382
383
    /**
384
     * @return mixed
385
     */
386
    public function getResourceId()
387
    {
388
        return $this->resourceId;
389
    }
390
391
    /**
392
     * @param mixed $resourceId
393
     */
394
    public function setResourceId($resourceId)
395
    {
396
        $this->resourceId = $resourceId;
397
    }
398
}
399