Test Failed
Pull Request — develop (#12)
by
unknown
02:48
created

SmartIdStatusResult   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 139
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 13
lcom 0
cbo 1
dl 139
loc 139
rs 10
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
A getFields() 11 11 1
A getStatus() 4 4 1
A getCode() 4 4 1
A getCountry() 4 4 1
A getName() 4 4 1
A getSurname() 4 4 1
A setStatus() 4 4 1
A setCode() 4 4 1
A setCountry() 4 4 1
A setName() 4 4 1
A setSurname() 4 4 1
A getCertificate() 4 4 1
A setCertificate() 4 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
namespace Isign\Login;
3
4
use Isign\StatusResultInterface;
5
6
/**
7
 * Result object for smart ID login status response.
8
 */
9 View Code Duplication
class SmartIdStatusResult extends AbstractStatusResult
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...
10
{
11
    /** @var string user's login certificate */
12
    private $certificate;
13
    
14
    /** @var string personal code */
15
    private $code;
16
    
17
    /** @var string Country code */
18
    private $country;
19
    
20
    /** @var string name */
21
    private $name;
22
    
23
    /** @var string surname */
24
    private $surname;
25
    
26
    /**
27
     * Fields expected in response
28
     * @return array
29
     */
30
    public function getFields()
31
    {
32
        return [
33
            'status',
34
            'certificate',
35
            'code',
36
            'country',
37
            'name',
38
            'surname',    
39
        ];
40
    }
41
    
42
    /**
43
     * @return string
44
     */
45
    public function getStatus()
46
    {
47
        return $this->status;
48
    }
49
    
50
    /**
51
     * @return string
52
     */
53
    public function getCode()
54
    {
55
        return $this->code;
56
    }
57
    
58
    /**
59
     * @return string
60
     */
61
    public function getCountry()
62
    {
63
        return $this->country;
64
    }
65
    
66
    /**
67
     * @return string
68
     */
69
    public function getName()
70
    {
71
        return $this->name;
72
    }
73
    
74
    /**
75
     * @return string
76
     */
77
    public function getSurname()
78
    {
79
        return $this->surname;
80
    }
81
    
82
    /**
83
     * Set status
84
     * @param string $status
85
     * @return void
86
     */
87
    public function setStatus($status)
88
    {
89
        $this->status = $status;
90
    }
91
    
92
    /**
93
     * Set code
94
     * @param string $code
95
     * @return void
96
     */
97
    public function setCode($code)
98
    {
99
        $this->code = $code;
100
    }
101
    
102
    /**
103
     * Set country
104
     * @param string $country
105
     * @return void
106
     */
107
    public function setCountry($country)
108
    {
109
        $this->country = $country;
110
    }
111
    
112
    /**
113
     * Set name
114
     * @param string $name
115
     * @return void
116
     */
117
    public function setName($name)
118
    {
119
        $this->name = $name;
120
    }
121
    
122
    /**
123
     * Set surname
124
     * @param string $surname
125
     * @return void
126
     */
127
    public function setSurname($surname)
128
    {
129
        $this->surname = $surname;
130
    }
131
    
132
    /**
133
     * @return string
134
     */
135
    public function getCertificate()
136
    {
137
        return $this->certificate;
138
    }
139
140
    /**
141
     * @param string $certificate
142
     */
143
    public function setCertificate($certificate)
144
    {
145
        $this->certificate = $certificate;
146
    }
147
}
148