ExchangeRateModel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModelMap() 6 6 1
A getDateMap() 7 7 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\ExchangeRates;
4
5
use Fousky\Component\iDoklad\Model\Currencies\CurrencyApiModel;
6
use Fousky\Component\iDoklad\Model\iDokladAbstractModel;
7
8
/**
9
 * @method null|string getId()
10
 * @method null|float getAmount()
11
 * @method null|CurrencyApiModel getCurrency()
12
 * @method null|int getCurrencyId()
13
 * @method null|\DateTime getDate()
14
 * @method null|\DateTime getDateLastChange()
15
 * @method null|int getExchangeListId()
16
 * @method null|float getExchangeRateValue()
17
 *
18
 * @author Lukáš Brzák <[email protected]>
19
 */
20 View Code Duplication
class ExchangeRateModel 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...
21
{
22
    protected $Id;
23
24
    protected $Amount;
25
26
    protected $Currency;
27
28
    protected $CurrencyId;
29
30
    protected $Date;
31
32
    protected $DateLastChange;
33
34
    protected $ExchangeListId;
35
36
    protected $ExchangeRateValue;
37
38
    /**
39
     * @return array
40
     */
41
    public static function getModelMap(): array
42
    {
43
        return [
44
            'Currency' => CurrencyApiModel::class,
45
        ];
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public static function getDateMap(): array
52
    {
53
        return [
54
            'Date',
55
            'DateLastChange',
56
        ];
57
    }
58
}
59