Completed
Push — master ( 17d161...0d226c )
by Klochok
06:57
created

BackupingRepresentations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 2
dl 23
loc 23
ccs 0
cts 13
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fillRepresentations() 20 20 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
namespace hipanel\modules\hosting\grid;
4
5
use hiqdev\higrid\representations\RepresentationCollection;
6
use Yii;
7
8 View Code Duplication
class BackupingRepresentations extends RepresentationCollection
0 ignored issues
show
Duplication introduced by tofid
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...
9
{
10
    protected function fillRepresentations()
11
    {
12
        $this->representations = array_filter([
13
            'common' => [
14
                'label' => Yii::t('hipanel', 'common'),
15
                'columns' => [
16
                    'checkbox',
17
                    'main',
18
                    'client',
19
                    'account',
20
                    'server',
21
                    'backup_count',
22
                    'type',
23
                    'state_label',
24
                    'backup_last',
25
                    'total_du',
26
                ],
27
            ],
28
        ]);
29
    }
30
}
31