| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 9 |
| Ratio | 100 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function showRanking() |
||
| 13 | { |
||
| 14 | $this->setRank(); |
||
| 15 | |||
| 16 | $rankObj = DB::select('SELECT first_name,scoutname,last_name,rank,total_points,start,end FROM users WHERE total_points > 0 ORDER BY rank DESC, total_points DESC;'); |
||
| 17 | $rankArray = json_decode(json_encode($rankObj), true); |
||
| 18 | $userRank = count($rankArray); |
||
| 19 | |||
| 20 | return view('leader.ranking', ['rankArray' => $rankArray, 'userRank' => $userRank]); |
||
| 21 | } |
||
| 27 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.