Completed
Push — master ( 1dd400...cdfa80 )
by Alexey
04:26
created

Change   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A relations() 8 8 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 Dashboard\Activity;
15
16 View Code Duplication
class Change extends \Model {
17
18
  static $logging = false;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $logging.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
19
  static $cols = [
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $cols.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
20
      'activity_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'activity'],
21
      'col' => ['type' => 'text'],
22
      'old' => ['type' => 'textarea'],
23
      'new' => ['type' => 'textarea'],
24
      'date_create' => ['type' => 'dateTime']
25
  ];
26
27
  static function relations() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
28
    return [
29
        'activity' => [
30
            'col' => 'activity_id',
31
            'model' => 'Dashboard\Activity'
32
        ]
33
    ];
34
  }
35
36
}
37