GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( a6bbd2...6f4a54 )
by Caspar
05:53
created

RankingController::showRanking()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 9
loc 9
rs 9.6666
c 2
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Support\Facades\DB;
6
7 View Code Duplication
class RankingController extends Controller
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
8
{
9
    /**
10
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
11
     */
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
    }
22
23
    private function setRank(){
24
	    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;');
25
    }
26
}
27