PatientPED   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 224
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 15
c 1
b 0
f 0
lcom 0
cbo 1
dl 224
loc 224
rs 10

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getAktywnoscFizyczna() 4 4 1
A getHigiena() 4 4 1
A getKarmienieIOdzywianie() 4 4 1
A getWydalanie() 4 4 1
A getPomiarParametrowZyciowych() 4 4 1
A getLeczenie() 4 4 1
A getEdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow() 4 4 1
A setAktywnoscFizyczna() 5 5 1
A setHigiena() 5 5 1
A setKarmienieIOdzywianie() 5 5 1
A setWydalanie() 5 5 1
A setPomiarParametrowZyciowych() 5 5 1
A setLeczenie() 5 5 1
A setEdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow() 5 5 1
A getFields() 14 14 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
 * PatientPED
4
 *
5
 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
6
 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
7
 *
8
 * Permission is hereby granted to use or copy this program
9
 * for any purpose, provided the above notices are retained on all copies.
10
 * Permission to modify the code and to distribute modified code is granted,
11
 * provided the above notices are retained, and a notice that the code was
12
 * modified is included with the above copyright notice.
13
 *
14
 * @category  Wp
15
 * @package   Punction
16
 * @author    Andrzej Marcinkowski <[email protected]>
17
 * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz
18
 * @license   MIT http://opensource.org/licenses/MIT
19
 * @version   1.0 $Format:%H$
20
 * @link      http://
21
 * @since     File available since Release 1.0.0
22
 * PHP Version 5
23
 */
24
namespace Hospitalplugin\Entities;
25
26
/**
27
 * PatientPED
28
 *
29
 * @category  Wp
30
 * @package   Punction
31
 * @author    Andrzej Marcinkowski <[email protected]>
32
 * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz
33
 * @license   MIT http://opensource.org/licenses/MIT
34
 * @version   1.0 $Format:%H$
35
 * @link      http://
36
 * @since     File available since Release 1.0.0
37
 *
38
 * @Entity
39
 */
40 View Code Duplication
class PatientPED extends Patient
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...
41
{
42
43
    /**
44
     * @var string $typ typ pacjenta
45
     */
46
    protected $typ = "PED";
47
48
    /**
49
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
50
     */
51
    public $aktywnoscFizyczna;
52
53
    /**
54
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
55
     */
56
    public $higiena;
57
58
    /**
59
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
60
     */
61
    public $karmienieIOdzywianie;
62
63
    /**
64
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
65
     */
66
    public $wydalanie;
67
68
    /**
69
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
70
     */
71
    public $pomiarParametrowZyciowych;
72
73
    /**
74
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
75
     */
76
    public $leczenie;
77
78
    /**
79
     * @Column(columnDefinition="TINYINT(4) DEFAULT 0")
80
     */
81
    public $edukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow;
82
83
    /**
84
     * getaktywnoscFizyczna
85
     * 
86
     * @return aktywnoscFizyczna int
87
     */
88
    public function getAktywnoscFizyczna()
89
    {
90
        return $this->aktywnoscFizyczna;
91
    }
92
93
    /**
94
     * setaktywnoscFizyczna
95
     * 
96
     * @param int $aktywnoscFizyczna aktywnosc fizyczna
97
     * 
98
     * @return PatientPED
99
     */
100
    public function setAktywnoscFizyczna($aktywnoscFizyczna)
101
    {
102
        $this->aktywnoscFizyczna = $aktywnoscFizyczna;
103
        return $this;
104
    }
105
106
    /**
107
     * getHigiena
108
     * 
109
     * @return Higiena int Higiena
110
     */
111
    public function getHigiena()
112
    {
113
        return $this->higiena;
114
    }
115
116
    /**
117
     * setHigiena
118
     * 
119
     * @param int $Higiena int higiena
0 ignored issues
show
Documentation introduced by
There is no parameter named $Higiena. Did you maybe mean $higiena?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
120
     * 
121
     * @return PatientPED
122
     */
123
    public function setHigiena($higiena)
124
    {
125
        $this->higiena = $higiena;
126
        return $this;
127
    }
128
129
    /**
130
     * getKarmienieIOdzywianie
131
     * 
132
     * @return KarmienieIOdzywianie
133
     */
134
    public function getKarmienieIOdzywianie()
135
    {
136
        return $this->karmienieIOdzywianie;
137
    }
138
139
    /**
140
     * setKarmienieIOdzywianie
141
     * 
142
     * @param int $KarmienieIOdzywianie itn karmienieIOdzywianie
0 ignored issues
show
Documentation introduced by
There is no parameter named $KarmienieIOdzywianie. Did you maybe mean $karmienieIOdzywianie?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
143
     * 
144
     * @return PatientPED
145
     */
146
    public function setKarmienieIOdzywianie($karmienieIOdzywianie)
147
    {
148
        $this->karmienieIOdzywianie = $karmienieIOdzywianie;
149
        return $this;
150
    }
151
152
    /**
153
     * getWydalanie
154
     * 
155
     * @return Wydalanie
156
     */
157
    public function getWydalanie()
158
    {
159
        return $this->wydalanie;
160
    }
161
162
    /**
163
     * PatientPED
164
     * 
165
     * @param int $Wydalanie Wydalanie
0 ignored issues
show
Documentation introduced by
There is no parameter named $Wydalanie. Did you maybe mean $wydalanie?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
166
     * 
167
     * @return PatientPED
168
     */
169
    public function setWydalanie($wydalanie)
170
    {
171
        $this->wydalanie = $wydalanie;
172
        return $this;
173
    }
174
175
    /**
176
     * getPomiarParametrowZyciowych
177
     * 
178
     * @return PomiarParametrowZyciowych
179
     */
180
    public function getPomiarParametrowZyciowych()
181
    {
182
        return $this->pomiarParametrowZyciowych;
183
    }
184
185
    /**
186
     * setPomiarParametrowZyciowych
187
     * 
188
     * @param int $PomiarParametrowZyciowych int PomiarParametrowZyciowych
0 ignored issues
show
Documentation introduced by
There is no parameter named $PomiarParametrowZyciowych. Did you maybe mean $pomiarParametrowZyciowych?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
189
     * 
190
     * @return PatientPED
191
     */
192
    public function setPomiarParametrowZyciowych($pomiarParametrowZyciowych)
193
    {
194
        $this->pomiarParametrowZyciowych = $pomiarParametrowZyciowych;
195
        return $this;
196
    }
197
198
    /**
199
     * getLeczenie
200
     * 
201
     * @return Leczenie
202
     */
203
    public function getLeczenie()
204
    {
205
        return $this->leczenie;
206
    }
207
208
    /**
209
     * setLeczenie
210
     * 
211
     * @param int $Leczenie int Leczenie
212
     * 
213
     * @return PatientPED
214
     */
215
    public function setLeczenie($Leczenie)
216
    {
217
        $this->leczenie = $Leczenie;
218
        return $this;
219
    }
220
221
    /**
222
     * getEdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow
223
     * 
224
     * @return EdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow
225
     */
226
    public function getEdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow()
227
    {
228
        return $this->edukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow;
229
    }
230
231
    /**
232
     * setEdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow
233
     * 
234
     * @param int $EdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow int ezowdir
235
     * 
236
     * @return PatientPED
237
     */
238
    public function setEdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow($EdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow)
239
    {
240
        $this->edukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow = $EdukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow;
241
        return $this;
242
    }
243
244
    /**
245
     * getFields
246
     *
247
     * @return multitype:string
0 ignored issues
show
Documentation introduced by
The doc-type multitype:string could not be parsed: Unknown type name "multitype:string" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
248
     */
249
    public static function getFields()
250
    {
251
        $superFields = parent::getFields();
252
        $fields = array_merge($superFields, array(
253
            "aktywnoscFizyczna",
254
            "higiena",
255
            "karmienieIOdzywianie",
256
            "wydalanie",
257
            "pomiarParametrowZyciowych",
258
            "leczenie",
259
            "edukacjaZdrowotnaOrazWsparcieDzieckaIRodzicow"
260
        ));
261
        return $fields;
262
    }
263
}
264