Entity
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 10
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

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 Faulancer\ORM\User;
4
5
use Faulancer\ORM\Entity as BaseEntity;
6
7
/**
8
 * Class Entity
9
 *
10
 * @property int    $id
11
 * @property string $firstname
12
 * @property string $lastname
13
 * @property string $email
14
 * @property string $login
15
 * @property string $password
16
 * @property Role[] $roles
17
 *
18
 * @package Faulancer\ORM\Entity
19
 * @author  Florian Knapp <[email protected]>
20
 */
21 View Code Duplication
class Entity extends BaseEntity
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
    protected static $relations = [
25
        'roles' => [Role::class, ['id' => 'user_id'], 'users', 'userrole']
26
    ];
27
28
    protected static $tableName = 'user';
29
30
}