Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function run($orgOnly = self::ORG_ALL) |
||
34 | { |
||
35 | $user = Yii::$app->user->identity; |
||
36 | /* @var $user User */ |
||
37 | $noInitOrg = $user->getNoInitOrganization(); |
||
38 | /* @var $noInitOrg Organization */ |
||
39 | $searchModel = $noInitOrg->getSearchModel(); |
||
40 | $dataProvider = $searchModel->search(Yii::$app->request->post()); |
||
41 | $query = ($orgOnly == self::ORG_ONLY) ? $user->getAtOrganizationsOnly() : $user->getAtOrganizations(); |
||
|
|||
42 | return $this->controller->render('index', [ |
||
43 | 'dataProvider' => $dataProvider, |
||
44 | 'searchModel' => $searchModel, |
||
45 | 'user' => $user, |
||
46 | 'orgOnly' => $orgOnly == self::ORG_ONLY, |
||
47 | ]); |
||
48 | } |
||
49 | } |
||
50 |
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.