IssuedInvoiceItemTypeEnum   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 92.86 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isTypeNormal() 4 4 1
A isTypeRound() 4 4 1
A isTypeReduced() 4 4 1
A isTypeDiscount() 2 4 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\LOV;
4
5
/**
6
 * @see https://app.idoklad.cz/developer/Help/v2/cs/ResourceModel?modelName=IssuedInvoiceItemTypeEnum
7
 *
8
 * @author Lukáš Brzák <[email protected]>
9
 */
10 View Code Duplication
class IssuedInvoiceItemTypeEnum extends iDokladAbstractEnum
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...
11
{
12
    const TYPE_NORMAL = 0;
13
14
    const TYPE_ROUND = 1;
15
16
    const TYPE_REDUCED = 2;
17
18
    const TYPE_DISCOUNT = 3;
19
20
    /**
21
     * @return bool
22
     */
23
    public function isTypeNormal(): bool
24
    {
25
        return self::TYPE_NORMAL === $this->getValue();
26
    }
27
28
    /**
29
     * @return bool
30
     */
31
    public function isTypeRound(): bool
32
    {
33
        return self::TYPE_ROUND === $this->getValue();
34
    }
35
36
    /**
37
     * @return bool
38
     */
39
    public function isTypeReduced(): bool
40
    {
41
        return self::TYPE_REDUCED === $this->getValue();
42
    }
43
44
    /**
45
     * @return bool
46
     */
47
    public function isTypeDiscount(): bool
48
    {
49
        return self::TYPE_DISCOUNT === $this->getValue();
50
    }
51
}
52