GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MapHelper   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 69
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 69
loc 69
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A render() 6 6 1
A renderHtml() 6 6 1
A renderStylesheet() 4 4 1
A renderJavascript() 4 4 1
A getName() 4 4 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 file is part of the Ivory Google Map bundle package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMapBundle\Templating;
13
14
use Ivory\GoogleMap\Helper\MapHelper as BaseMapHelper;
15
use Ivory\GoogleMap\Map;
16
use Symfony\Component\Templating\Helper\Helper;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21 View Code Duplication
class MapHelper extends Helper
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...
22
{
23
    /**
24
     * @var BaseMapHelper
25
     */
26
    private $mapHelper;
27
28
    /**
29
     * @param BaseMapHelper $mapHelper
30
     */
31 45
    public function __construct(BaseMapHelper $mapHelper)
32
    {
33 45
        $this->mapHelper = $mapHelper;
34 45
    }
35
36
    /**
37
     * @param Map      $map
38
     * @param string[] $attributes
39
     *
40
     * @return string
41
     */
42 9
    public function render(Map $map, array $attributes = [])
43
    {
44 9
        $map->addHtmlAttributes($attributes);
45
46 9
        return $this->mapHelper->render($map);
47
    }
48
49
    /**
50
     * @param Map      $map
51
     * @param string[] $attributes
52
     *
53
     * @return string
54
     */
55 9
    public function renderHtml(Map $map, array $attributes = [])
56
    {
57 9
        $map->addHtmlAttributes($attributes);
58
59 9
        return $this->mapHelper->renderHtml($map);
60
    }
61
62
    /**
63
     * @param Map $map
64
     *
65
     * @return string
66
     */
67 9
    public function renderStylesheet(Map $map)
68
    {
69 9
        return $this->mapHelper->renderStylesheet($map);
70
    }
71
72
    /**
73
     * @param Map $map
74
     *
75
     * @return string
76
     */
77 9
    public function renderJavascript(Map $map)
78
    {
79 9
        return $this->mapHelper->renderJavascript($map);
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85 9
    public function getName()
86
    {
87 9
        return 'ivory_google_map';
88
    }
89
}
90