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.

AnalysisException::calculateCCN()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Inspector\Analysis\Exception;
4
5
use Inspector\Analysis\Complexity\ComplexityComputer;
6
use PhpParser\Node;
7
use Inspector\Application\Exception\Exception;
8
9
class AnalysisException extends Exception
10
{
11
12
    /**
13
     * @var ComplexityComputer
14
     */
15
    protected static $complexityComputer;
16
17
    /**
18
     * @var Node
19
     */
20
    protected $node;
21
22
    /**
23
     * @return Node
24
     */
25
    public function getNode()
26
    {
27
        return $this->node;
28
    }
29
30
    /**
31
     * @return int|array
32
     */
33
    public function getLineNumber()
34
    {
35
        $startLine = $this->node->getAttribute('startLine');
36
        $endLine = $this->node->getAttribute('endLine');
37
38
        return ($startLine === $endLine) ? $startLine : [$startLine, $endLine];
39
    }
40
41
    /**
42
     * @param Node $node
43
     * @return $this
44
     */
45
    public function setNode(Node $node)
46
    {
47
        $this->node = $node;
48
49
        return $this;
50
    }
51
52
    /**
53
     * Returns a new Exception instance with node.
54
     *
55
     * @param Node $node
56
     * @return AnalysisException
57
     */
58
    public static function withNode(Node $node)
59
    {
60
61
        return (new static())->setNode($node);
62
    }
63
64
    /**
65
     * Returns params for the message.
66
     *
67
     * @return array
68
     */
69
    public function getMessageParams()
70
    {
71
        return [];
72
    }
73
74
    public static function setComplexityComputer(ComplexityComputer $complexityComputer)
75
    {
76
        static::$complexityComputer = $complexityComputer;
77
    }
78
79
    /**
80
     * Calculates Cylomatic Complexity Number.
81
     *
82
     * @param Node $node
83
     * @return int
84
     */
85
    protected static function calculateCCN(Node $node)
86
    {
87
        return static::$complexityComputer->compute($node);
88
    }
89
}
90