| Conditions | 6 |
| Paths | 18 |
| Total Lines | 39 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function actionView($id) |
||
| 11 | { |
||
| 12 | $cl = new ContestList(); |
||
|
|
|||
| 13 | $cl->id = $id; |
||
| 14 | $cl->uid = Yii::app()->player->uid; |
||
| 15 | |||
| 16 | //redirections |
||
| 17 | if (!$cl->isValid) { |
||
| 18 | $lastId = $cl->lastId; |
||
| 19 | if ($lastId) { |
||
| 20 | Yii::app()->user->setFlash('error', 'A keresett verseny nem található, helyette a legújabbat láthatod.'); |
||
| 21 | $this->redirect(['/contest/view', 'id'=>$lastId]); |
||
| 22 | } else { |
||
| 23 | Yii::app()->user->setFlash('error', 'Még nem található horgászvarseny a játékban, de ez hamarosan megváltozik.'); |
||
| 24 | $this->redirect('/site'); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | $cl->fetchDetails(); |
||
| 29 | $cl->fetchList(); |
||
| 30 | if ($cl->maxScore) { |
||
| 31 | $cl->listBestPlayers(); |
||
| 32 | } |
||
| 33 | $cl->seeContest(); |
||
| 34 | |||
| 35 | //claim prize |
||
| 36 | $r = Yii::app()->request; |
||
| 37 | $getPrize = $r->getParam('getPrize', 0); |
||
| 38 | if ($getPrize) { |
||
| 39 | if ($cl->claimPrize()) { |
||
| 40 | Yii::app()->user->setFlash('success', 'A nyereményt jóváírtuk. Gratulálunk!'); |
||
| 41 | $this->redirect(['/contest/view', 'id'=>$cl->id]); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->render('view', [ |
||
| 46 | 'contestList'=>$cl, |
||
| 47 | ]); |
||
| 48 | } |
||
| 49 | |||
| 59 |
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.