Completed
Push — master ( ac44f9...7d4d5b )
by Klochok
05:18
created

IpActionsMenu   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

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 0
loc 38
ccs 0
cts 19
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B items() 0 33 1
1
<?php
2
3
namespace hipanel\modules\hosting\menus;
4
5
use hiqdev\menumanager\Menu;
6
use Yii;
7
8
class IpActionsMenu extends Menu
9
{
10
    public $model;
11
12
    public function items()
13
    {
14
        return [
15
            'view' => [
16
                'label' => Yii::t('hipanel', 'View'),
17
                'icon' => 'fa-info',
18
                'url' => ['@ip/view', 'id' => $this->model->id],
19
            ],
20
            'expand' => [
21
                'label' => Yii::t('hipanel:hosting', 'Expand'),
22
                'icon' => 'fa-th',
23
                'url' => ['@ip/expand', 'id' => $this->model->id],
24
            ],
25
            'update' => [
26
                'label' => Yii::t('hipanel', 'Update'),
27
                'icon' => 'fa-pencil',
28
                'url' => ['@ip/update', 'id' => $this->model->id],
29
                'visible' => Yii::$app->user->can('admin'),
30
            ],
31
//            'delete' => [
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
32
//                'label' => Yii::t('hipanel', 'Delete'),
33
//                'icon' => 'fa-trash',
34
//                'url' => ['@ip/delete', 'id' => $this->model->id],
35
//                'linkOptions' => [
36
//                    'data' => [
37
//                        'confirm' => Yii::t('hipanel', 'Are you sure you want to delete this item?'),
38
//                        'method' => 'POST',
39
//                        'pjax' => '0',
40
//                    ],
41
//                ],
42
//            ],
43
        ];
44
    }
45
}
46