Person   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 82.05 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 32
loc 39
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 1 7 2

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
 * MOJEPANSTWO-API
4
 *
5
 * Copyright © 2017 pudelek.org.pl
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For the full copyright and license information, please view source file
10
 * that is bundled with this package in the file LICENSE
11
 *
12
 * @author Marcin Pudełek <[email protected]>
13
 */
14
15
declare (strict_types=1);
16
17
namespace mrcnpdlk\MojePanstwo\Model\KrsEntity;
18
19
use mrcnpdlk\MojePanstwo\Model\ModelAbstract;
20
21 View Code Duplication
class Person extends ModelAbstract
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
    /**
24
     * @var integer
25
     */
26
    public $osoba_id;
27
    /**
28
     * @var string
29
     */
30
    public $nazwa;
31
    /**
32
     * @var string
33
     */
34
    public $data_urodzenia;
35
    /**
36
     * @var string
37
     */
38
    public $privacy_level;
39
    /**
40
     * @var string
41
     */
42
    public $funkcja;
43
44
45
    /**
46
     * Person constructor.
47
     *
48
     * @param \stdClass|null $oData
49
     *
50
     * @throws \mrcnpdlk\MojePanstwo\Exception
51
     */
52
    public function __construct(\stdClass $oData = null)
53
    {
54
        parent::__construct($oData);
55
        if ($oData) {
56
            $this->osoba_id = $this->convertToId($this->osoba_id);
57
        }
58
    }
59
}
60