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 Failed
Pull Request — master (#23)
by
unknown
04:37 queued 19s
created

CellTokenParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 5
dl 35
loc 35
ccs 9
cts 9
cp 1
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 MyWheels\TwigSpreadsheetBundle\Twig\TokenParser;
4
5
use MyWheels\TwigSpreadsheetBundle\Twig\Node\CellNode;
6
7
/**
8
 * Class CellTokenParser.
9
 */
10 View Code Duplication
class CellTokenParser 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...
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 41
    public function configureParameters(\Twig_Token $token): array
16
    {
17
        return [
18
            'index' => [
19 41
                'type' => self::PARAMETER_TYPE_VALUE,
20 41
                'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Node_Expression_Constant has been deprecated with message: since Twig 2.7, use "Twig\Node\Expression\ConstantExpression" instead

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
            'properties' => [
23 41
                'type' => self::PARAMETER_TYPE_ARRAY,
24 41
                'default' => new \Twig_Node_Expression_Array([], $token->getLine()),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Node_Expression_Array has been deprecated with message: since Twig 2.7, use "Twig\Node\Expression\ArrayExpression" instead

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...
25
            ],
26
        ];
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 41
    public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node
33
    {
34 41
        return new CellNode($nodes, $this->getAttributes(), $lineNo, $this->getTag());
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 43
    public function getTag()
41
    {
42 43
        return 'xlscell';
43
    }
44
}
45