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.
Test Setup Failed
Push — master ( 78f8b7...0f754d )
by Elemér
04:15
created

DrawingTokenParser   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 43
loc 43
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configureParameters() 13 13 1
A createNode() 4 4 1
A getTag() 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
namespace Erelke\TwigSpreadsheetBundle\Twig\TokenParser;
4
5
use Erelke\TwigSpreadsheetBundle\Twig\Node\DrawingNode;
6
use Twig\Node\Node as Twig_Node;
7
use Twig\Node\Expression\ArrayExpression as Twig_Node_Expression_Array;
8
use Twig\Token as Twig_Token;
9
10
/**
11
 * Class DrawingTokenParser.
12
 */
13 View Code Duplication
class DrawingTokenParser extends BaseTokenParser
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...
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function configureParameters(Twig_Token $token): array
19
    {
20
        return [
21
            'path' => [
22
                'type' => self::PARAMETER_TYPE_VALUE,
23
                'default' => false,
24
            ],
25
            'properties' => [
26
                'type' => self::PARAMETER_TYPE_ARRAY,
27
                'default' => new Twig_Node_Expression_Array([], $token->getLine()),
28
            ],
29
        ];
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function createNode(array $nodes = [], int $lineNo = 0): Twig_Node
36
    {
37
        return new DrawingNode($nodes, $this->getAttributes(), $lineNo, $this->getTag());
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getTag()
44
    {
45
        return 'xlsdrawing';
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function hasBody(): bool
52
    {
53
        return false;
54
    }
55
}
56