Import   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 46.67 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildMenu() 7 7 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
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
10
namespace AnimeDb\Bundle\CatalogBundle\Plugin\Import;
11
12
use AnimeDb\Bundle\CatalogBundle\Plugin\Plugin;
13
use Knp\Menu\ItemInterface;
14
15
/**
16
 * Plugin import.
17
 *
18
 * @author  Peter Gribanov <[email protected]>
19
 */
20
abstract class Import extends Plugin implements ImportInterface
0 ignored issues
show
Deprecated Code introduced by
The class AnimeDb\Bundle\CatalogBundle\Plugin\Plugin has been deprecated with message: use PluginInterface

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
21
{
22
    /**
23
     * @param ItemInterface $item
24
     *
25
     * @return ItemInterface
26
     */
27 1 View Code Duplication
    public function buildMenu(ItemInterface $item)
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...
28
    {
29 1
        return $item->addChild($this->getTitle(), [
30 1
            'route' => 'item_import',
31 1
            'routeParameters' => ['plugin' => $this->getName()],
32 1
        ]);
33
    }
34
}
35