BankApiModel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 40
loc 40
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModelMap() 6 6 1
A getDateMap() 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 Fousky\Component\iDoklad\Model\Banks;
4
5
use Fousky\Component\iDoklad\Model\Countries\CountryApiModel;
6
use Fousky\Component\iDoklad\Model\iDokladAbstractModel;
7
8
/**
9
 * @method string|null getId()
10
 * @method string|null getCode()
11
 * @method string|null getCountry()
12
 * @method string|null getCountryId()
13
 * @method \DateTime|null getDateLastChange()
14
 * @method string|null getIsOutOfDate()
15
 * @method string|null getName()
16
 * @method string|null getNumberCode()
17
 * @method string|null getSwift()
18
 *
19
 * @author Lukáš Brzák <[email protected]>
20
 */
21 View Code Duplication
class BankApiModel extends iDokladAbstractModel
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...
22
{
23
    public $Id;
24
25
    public $Code;
26
27
    public $Country;
28
29
    public $CountryId;
30
31
    public $DateLastChange;
32
33
    public $IsOutOfDate;
34
35
    public $Name;
36
37
    public $NumberCode;
38
39
    public $Swift;
40
41
    /**
42
     * @return array
43
     */
44
    public static function getModelMap(): array
45
    {
46
        return [
47
            'Country' => CountryApiModel::class,
48
        ];
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    public static function getDateMap(): array
55
    {
56
        return [
57
            'DateLastChange',
58
        ];
59
    }
60
}
61