Module   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 4
Bugs 4 Features 0
Metric Value
wmc 2
c 4
b 4
f 0
lcom 0
cbo 0
dl 28
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 4 4 1
A getAutoloaderConfig() 10 10 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
/**
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the MIT license.
18
 */
19
namespace LearnZF2Navigation;
20
21
use Zend\Loader\StandardAutoloader;
22
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
23
use Zend\ModuleManager\Feature\ConfigProviderInterface;
24
25
/**
26
 * Class Module.
27
 *
28
 * @author Alejandro Celaya Alastrué <[email protected]>
29
 */
30 View Code Duplication
class Module implements ConfigProviderInterface, AutoloaderProviderInterface
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...
31
{
32
    /**
33
     * Returns configuration to merge with application configuration.
34
     *
35
     * @return array|\Traversable
36
     */
37
    public function getConfig()
38
    {
39
        return include __DIR__.'/config/module.config.php';
40
    }
41
42
    /**
43
     * Return an array for passing to Zend\Loader\AutoloaderFactory.
44
     *
45
     * @return array
46
     */
47
    public function getAutoloaderConfig()
48
    {
49
        return [
50
            'Zend\Loader\StandardAutoloader' => [
51
                StandardAutoloader::LOAD_NS => [
52
                    __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__,
53
                ],
54
            ],
55
        ];
56
    }
57
}
58