| Conditions | 3 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | private function makeBoard($type, $range) |
||
| 18 | { |
||
| 19 | $board = new Leaderboard; |
||
|
|
|||
| 20 | $board->uid = Yii::app()->player->model->uid; |
||
| 21 | $board->inClub = Yii::app()->player->model->in_club; |
||
| 22 | $board->boardType = $type; |
||
| 23 | |||
| 24 | switch ($range) { |
||
| 25 | case 'prev': |
||
| 26 | $board->setRange(Leaderboard::RANGE_PREVIOUS); |
||
| 27 | break; |
||
| 28 | case 'last': |
||
| 29 | $board->setRange(Leaderboard::RANGE_LAST_SIX); |
||
| 30 | break; |
||
| 31 | default: |
||
| 32 | $board->setRange(Leaderboard::RANGE_ACTUAL); |
||
| 33 | break; |
||
| 34 | } |
||
| 35 | $board->fetchList(); |
||
| 36 | |||
| 37 | $this->render('index', [ |
||
| 38 | 'board'=>$board, |
||
| 39 | ]); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.