Module   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 23
loc 23
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerAutoloaders() 4 4 1
A registerServices() 13 13 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
namespace Admin;
4
5 View Code Duplication
class Module
6
{
7
8
    public function registerAutoloaders()
9
    {
10
11
    }
12
13
    public function registerServices($di)
14
    {
15
        $dispatcher = $di->get('dispatcher');
16
        $dispatcher->setDefaultNamespace("Admin\Controller");
17
        $di->set('dispatcher', $dispatcher);
18
19
        /**
20
         * Setting up the view component
21
         */
22
        $view = $di->get('view');
23
        $view->setViewsDir(__DIR__ . '/views/');
24
25
    }
26
27
}