Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function testIndexFileShown() |
||
18 | { |
||
19 | $crawler = $this->client->request('GET', '/'); |
||
|
|||
20 | $this->assertStatusCode(302, $this->client); |
||
21 | |||
22 | $location = $this->client->getResponse()->headers->get('Location'); |
||
23 | $this->assertEquals('/browse/?action=index', $location); |
||
24 | $crawler = $this->client->request('GET', $location); |
||
25 | $this->assertStatusCode(302, $this->client); |
||
26 | |||
27 | $location = $this->client->getResponse()->headers->get('Location'); |
||
28 | $this->assertEquals('/browse/index.md', $location); |
||
29 | $crawler = $this->client->request('GET', $location); |
||
30 | $this->assertStatusCode(200, $this->client); |
||
31 | |||
32 | $this->assertEquals('Welcome', $crawler->filter('h1')->text()); |
||
33 | } |
||
34 | } |
||
35 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
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.