Completed
Push — master ( d9ee57...46a621 )
by Andrii
03:57
created

ReauestDetailMenu   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
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 13
loc 13
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A ReaqestDetailMenu::items() 0 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
 * Hosting Plugin for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-hosting
6
 * @package   hipanel-module-hosting
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\hosting\menus;
12
13
use hiqdev\menumanager\Menu;
14
15
class ReaqestDetailMenu extends Menu
16
{
17
    public $model;
18
19
    public function items()
20
    {
21
        $actions = RequestActionsMenu::create(['model' => $this->model])->items();
22
        $items = array_merge($actions, []);
23
        unlink($items['view']);
24
25
        return $items;
26
    }
27
}
28