These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * GitHub API implementation for yii2-hiart |
||
4 | * |
||
5 | * @link https://github.com/hiqdev/yii2-hiart-github |
||
6 | * @package yii2-hiart-github |
||
7 | * @license BSD-3-Clause |
||
8 | * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/) |
||
9 | */ |
||
10 | |||
11 | namespace hiqdev\hiart\github\tests\functional; |
||
12 | |||
13 | use hiqdev\hiart\github\models\Repo; |
||
14 | |||
15 | class RepoTest extends \PHPUnit_Framework_TestCase |
||
16 | { |
||
17 | public function testFindOrganization() |
||
18 | { |
||
19 | $query = Repo::find()->where(['organization' => 'hiqdev']); |
||
20 | $models = $query->all(); |
||
0 ignored issues
–
show
|
|||
21 | } |
||
22 | |||
23 | public function testFindUser() |
||
24 | { |
||
25 | $query = Repo::find()->where(['user' => 'hiqsol']); |
||
26 | $models = $query->all(); |
||
0 ignored issues
–
show
$models 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
Loading history...
|
|||
27 | } |
||
28 | } |
||
29 |
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.