Completed
Push — master ( 2e5350...f0c5b4 )
by Tobias
10:07
created

Car   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

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 Happyr\SerializerBundle\Tests\Fixtures\Exclude;
4
5
use Happyr\SerializerBundle\Annotation as Serializer;
6
7
class Car
8
{
9
    /**
10
     * @Serializer\Exclude
11
     */
12
    private $model;
13
14
    private $size;
15
16
    public function __construct($withValues = false)
17
    {
18
        if ($withValues) {
19
            $this->model = 'val_model';
20
            $this->size = 'val_size';
21
        }
22
    }
23
}
24