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.
Completed
Push — master ( 166e15...37971c )
by Danger
02:40
created

BadgeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetBadgeSpecialita() 0 21 2
1
<?php
2
3
namespace Tests;
4
5
use Silex\WebTestCase;
6
use JsonSchema\Validator;
7
8
class BadgeTest extends WebTestCase
9
{
10
    use AbstractAppTest;
11
12
    public function testGetBadgeSpecialita(){
13
        $schema = __DIR__.'/../../../../api/schemas/badgeList.json';
14
        $client = $this->createClient();
15
        $client = $this->logIn($client);
16
17
        $kind_of_badge = ['specialita','brevetti','eventi'];
18
19
        foreach($kind_of_badge as $option){
20
21
            $crawler = $client->request('GET', '/api/v1/badge/?filterBy='.$option);
0 ignored issues
show
Unused Code introduced by
$crawler is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
22
            $response = $client->getResponse();
0 ignored issues
show
Unused Code introduced by
$response is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
23
24
            //print_r($response);
25
            $data = $client->getResponse()->getContent();
26
27
            $validator = $this->askValidation($data, $schema);
28
29
            $assert = $this->evalValidation($validator);
30
            $this->assertTrue($assert);
31
        }
32
    }
33
}
34