Completed
Push — master ( d123db...236d99 )
by Dmitry
09:19
created

SidebarMenu   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B items() 0 27 1
1
<?php
2
3
/*
4
 * HiPanel tickets module
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-ticket
7
 * @package   hipanel-module-ticket
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\ticket;
13
14
use Yii;
15
16
class SidebarMenu extends \hipanel\base\Menu implements \yii\base\BootstrapInterface
17
{
18
    protected $_addTo = 'sidebar';
19
20
    protected $_where = [
21
        'after' => ['finance', 'clients', 'dashboard', 'header'],
22
        'before' => ['domains', 'servers', 'hosting'],
23
    ];
24
25
    public function items()
26
    {
27
        return [
28
            'tickets' => [
29
                'label' => Yii::t('hipanel/ticket', 'Tickets'),
30
                'url' => ['/ticket/ticket/index'],
31
                'icon' => 'fa-ticket',
32
                'items' => [
33
                    'tickets' => [
34
                        'label' => Yii::t('hipanel/ticket', 'Tickets'),
35
                        'url' => ['/ticket/ticket/index'],
36
                    ],
37
                    'templates' => [
38
                        'label' => Yii::t('hipanel/ticket', 'Templates'),
39
                        'url' => ['/ticket/template/index'],
40
                        'visible' => function () {
41
                            return Yii::$app->user->can('support');
42
                        },
43
                    ],
44
//                  'statistics' => [
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% 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...
45
//                      'label' => Yii::t('hipanel/ticket', 'Tickets statistics'),
46
//                      'url'   => ['/ticket/ticket/statistics'],
47
//                  ],
48
                ],
49
            ],
50
        ];
51
    }
52
}
53