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.

InspectCommand   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 69
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getArguments() 0 6 1
A getOptions() 0 13 1
A execute() 0 12 2
1
<?php
2
3
namespace Inspector\Application\Commands;
4
5
use Inspector\Application\Command;
6
use Symfony\Component\Console\Input\InputOption;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Inspector\Application\Service\AnalyzerService;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class InspectCommand extends Command
13
{
14
15
    protected $name = 'inspect';
16
17
    protected $description = 'Inspects and analyzes the source code';
18
19
    /**
20
     * @var AnalyzerService
21
     */
22
    protected $analyzerService;
23
24
    /**
25
     * @param AnalyzerService $analyzerService
26
     */
27
    public function __construct(AnalyzerService $analyzerService)
28
    {
29
        parent::__construct();
30
31
        $this->analyzerService = $analyzerService;
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    protected function getArguments()
38
    {
39
        return [
40
            ['path', InputArgument::REQUIRED, 'Source path to inspect']
41
        ];
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    protected function getOptions()
48
    {
49
        return [
50
            ['generate-report', 'g', InputOption::VALUE_NONE, 'Generates analysis report'],
51
            ['path', 'p', InputOption::VALUE_OPTIONAL, 'Path to generate the report', getcwd()],
52
            [
53
                'show',
54
                'w',
55
                InputOption::VALUE_NONE,
56
                'When used with \'--generate-report\' option runs the Web server to show the generated report. '
57
            ],
58
        ];
59
    }
60
61
    /**
62
     * @param InputInterface $input
63
     * @param OutputInterface $output
64
     * @return int|null|void
65
     * @throws \Exception
66
     */
67
    protected function execute(InputInterface $input, OutputInterface $output)
68
    {
69
        $path = $input->getArgument('path');
70
        $options = $input->getOptions();
71
72
        if (!$options['quiet']) {
73
            $output->writeln("\n" . '<info>Inspecting</info> ' . $path);
74
        }
75
76
        $feedback = $this->analyzerService->analyze($path, $options);
77
        $output->writeln($feedback . "\n");
78
    }
79
80
}
81