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.
Completed
Push — master ( fd551c...0e9a28 )
by Mewes
15:42 queued 08:25
created

CenterNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 28
loc 28
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A compile() 11 11 1
A getAllowedParents() 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
namespace MewesK\TwigSpreadsheetBundle\Twig\Node;
4
5
/**
6
 * Class CenterNode.
7
 */
8 View Code Duplication
class CenterNode extends BaseNode
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...
9
{
10
    /**
11
     * @param \Twig_Compiler $compiler
12
     */
13 3
    public function compile(\Twig_Compiler $compiler)
14
    {
15 3
        $compiler->addDebugInfo($this)
16 3
            ->write(self::CODE_FIX_CONTEXT)
17 3
            ->write(self::CODE_INSTANCE.'->startAlignment(\'center\');'.PHP_EOL)
18 3
            ->write("ob_start();\n")
19 3
            ->subcompile($this->getNode('body'))
20 3
            ->write('$centerValue = trim(ob_get_clean());'.PHP_EOL)
21 3
            ->write(self::CODE_INSTANCE.'->endAlignment($centerValue);'.PHP_EOL)
22 3
            ->write('unset($centerValue);'.PHP_EOL);
23 3
    }
24
25
    /**
26
     * @return string[]
27
     */
28 3
    public function getAllowedParents(): array
29
    {
30
        return [
31 3
            FooterNode::class,
32
            HeaderNode::class,
33
        ];
34
    }
35
}
36