Completed
Pull Request — master (#47)
by Robbie
01:29
created

LeftAndMainExtension::accessedCMS()   A

Complexity

Conditions 3
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
dl 14
loc 14
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace LeKoala\DebugBar\Extension;
4
5
use LeKoala\DebugBar\DebugBar;
6
use SilverStripe\Admin\LeftAndMainExtension as BaseLeftAndMainExtension;
7
8
/**
9
 * Description of DebugBarLeftAndMainExtension
10
 *
11
 * @author Koala
12
 */
13
class LeftAndMainExtension extends BaseLeftAndMainExtension
14
{
15 View Code Duplication
    public function accessedCMS()
0 ignored issues
show
Duplication introduced by
This method 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
        DebugBar::withDebugBar(function (\DebugBar\DebugBar $debugbar) {
18
            /* @var $timeData DebugBar\DataCollector\TimeDataCollector */
19
            $timeData = $debugbar->getCollector('time');
20
            if (!$timeData) {
21
                return;
22
            }
23
            if ($timeData->hasStartedMeasure("init")) {
24
                $timeData->stopMeasure("init");
25
            }
26
            $timeData->startMeasure("cms_accessed", "cms accessed");
27
        });
28
    }
29
30 View Code Duplication
    public function init()
0 ignored issues
show
Duplication introduced by
This method 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...
31
    {
32
        DebugBar::withDebugBar(function (\DebugBar\DebugBar $debugbar) {
33
            /* @var $timeData DebugBar\DataCollector\TimeDataCollector */
34
            $timeData = $debugbar->getCollector('time');
35
            if (!$timeData) {
36
                return;
37
            }
38
            if ($timeData->hasStartedMeasure("cms_accessed")) {
39
                $timeData->stopMeasure("cms_accessed");
40
            }
41
            $timeData->startMeasure("cms_init", "cms init");
42
        });
43
    }
44
}
45