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.

StatusController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 33
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A connect() 0 9 1
A status() 0 17 1
1
<?php
2
3
namespace BitPrepared\Bundle\D1b0Workspace\Controller\V1;
4
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\HttpFoundation\JsonResponse;
8
use Silex\Application;
9
use Silex\Api\ControllerProviderInterface;
10
use Monolog\Logger;
11
12
class StatusController implements ControllerProviderInterface
13
{
14
15
    private $app;
16
17
    public function connect(Application $app)
18
    {
19
        $this->app = $app;
20
        $factory = $app['controllers_factory'];
21
        # il mount point e' precedente e non serve prima
22
        $factory->get('/', array($this, 'status'));
23
        //$factory->get('/status', 'BitPrepared\Bundle\D1b0Workspace\Controller\V1\StatusController::status');
0 ignored issues
show
Unused Code Comprehensibility introduced by
80% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
24
        return $factory;
25
    }
26
27
    public function status(Request $request)
28
    {
29
30
        // sample sintatticamente anche errato
31
        // $this->app['monolog']->addInfo(sprintf("Required '%s'.", 'status'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
74% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
32
        $this->app->log('log info', [], Logger::INFO); //grazie al traits <- da trasformare prima in app
33
34
        $data = array(
35
            "workspace" => "OK",
36
            "fileManager" => "OK",
37
            "externalLogin" => "OK"
38
        );
39
40
        $headers = [];
41
42
        return JsonResponse::create($data, 200, $headers)->setSharedMaxAge(300);
43
    }
44
}
45