BoxedDetailView   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 10 10 2

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
 * HiPanel core package
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\grid;
12
13
use hipanel\widgets\Box;
14
15 View Code Duplication
class BoxedDetailView extends DetailView
0 ignored issues
show
Duplication introduced by
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...
16
{
17
    public $boxed = true;
18
    /**
19
     * To grid options, for example, you may add something like this for customize boxes:
20
     *  'boxOptions' => ['options' => ['class' => 'box-primary']],.
21
     * @var array
22
     */
23
    public $boxOptions = [];
24
25
    public function run()
26
    {
27
        if ($this->boxed) {
28
            Box::begin($this->boxOptions);
29
            echo parent::run();
30
            Box::end();
31
        } else {
32
            return parent::run();
33
        }
34
    }
35
}
36