Total Complexity | 7 |
Total Lines | 66 |
Duplicated Lines | 21.21 % |
Coverage | 93.55% |
Changes | 0 |
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 |
||
10 | class TransferMetadata extends ClassMetadata |
||
11 | { |
||
12 | /** |
||
13 | * @var PropertyMetadata |
||
14 | */ |
||
15 | public $id; |
||
16 | |||
17 | /** |
||
18 | * @var PropertyMetadata |
||
19 | */ |
||
20 | public $associations; |
||
21 | |||
22 | 17 | public function addPropertyMetadata(BasePropertyMetadata $metadata) |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param string $name |
||
41 | * @return PropertyMetadata |
||
42 | */ |
||
43 | public function getAssociation(string $name) |
||
46 | } |
||
47 | |||
48 | 4 | public function serialize() |
|
59 | )); |
||
60 | } |
||
61 | |||
62 | 3 | View Code Duplication | public function unserialize($str) |
78 |