Completed
Push — master ( a505a0...5d1dca )
by Fèvre
20s
created

UsersLogsTable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 60.87 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 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
namespace App\Model\Table;
3
4
use Cake\ORM\Table;
5
6
class UsersLogsTable extends Table
7
{
8
    /**
9
     * Initialize method
10
     *
11
     * @param array $config The configuration for the Table.
12
     * @return void
13
     */
14 View Code Duplication
    public function initialize(array $config)
0 ignored issues
show
Duplication introduced by
This method 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...
15
    {
16
        parent::initialize($config);
17
18
        $this->table('users_logs');
19
        $this->displayField('name');
20
        $this->primaryKey('id');
21
22
        $this->addBehavior('Timestamp');
23
24
        $this->belongsTo('Users', [
25
            'foreignKey' => 'user_id'
26
        ]);
27
    }
28
}
29