Completed
Push — master ( c0f2e9...bf06e8 )
by Alexey
05:57
created

Param   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A relations() 9 9 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
3
/**
4
 * Item name
5
 *
6
 * Info
7
 *
8
 * @author Alexey Krupskiy <[email protected]>
9
 * @link http://inji.ru/
10
 * @copyright 2016 Alexey Krupskiy
11
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
12
 */
13
14
namespace Money\Reward\Trigger;
15
16 View Code Duplication
class Param extends \Model
17
{
18
    public static $cols = [
19
        'reward_trigger_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'trigger'],
20
        'param' => ['type' => 'text'],
21
        'value' => ['type' => 'text'],
22
    ];
23
24
    public static function relations()
25
    {
26
        return [
27
            'trigger' => [
28
                'model' => 'Money\Reward\Trigger',
29
                'col' => 'reward_trigger_id'
30
            ],
31
        ];
32
    }
33
34
}
35