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.

MethodComplexityChecker::check()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
cc 3
eloc 3
nc 2
nop 1
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Inspector\Analysis\Checker\Complexity;
4
5
use PhpParser\Node;
6
use PhpParser\Node\Stmt\ClassMethod;
7
use Inspector\Analysis\Exception\MethodTooComplexException;
8
use Inspector\Analysis\Checker\Complexity\AbstractComplexityChecker as ComplexityChecker;
9
10 View Code Duplication
class MethodComplexityChecker extends ComplexityChecker
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
    /**
14
     * Checks to make sure the class method is not that complex
15
     *
16
     * @param Node $node
17
     * @throws MethodTooComplexException
18
     */
19
    public function check(Node $node)
20
    {
21
        if (($node instanceof ClassMethod) && $this->isComplex($node)) {
22
            throw (new MethodTooComplexException)->setNode($node);
23
        }
24
    }
25
26
    /**
27
     * @param array $params
28
     * @return $this
29
     */
30
    public function setParameters(array $params)
31
    {
32
        $this->setThreshold($params['complexity_threshold']['method']);
33
34
        return $this;
35
    }
36
}
37