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.
Completed
Push — master ( 4ae868...e85935 )
by Caspar
49:08 queued 45:24
created

RankingController::setRank()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 5
c 1
b 1
f 0
nc 2
nop 0
dl 8
loc 8
rs 9.4285
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
     * Rangliste wird geholt und an View übergeben.
11
     *
12
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
13
     */
14
    public function showRanking()
15
    {
16
        CodeCount::setRank();
17
18
        $rankObj = DB::select('SELECT * FROM users WHERE total_points > 0 ORDER BY total_points DESC,rank;');
19
        $rankArray = json_decode(json_encode($rankObj), true);
20
        $userRank = count($rankArray);
21
22
        return view('leader.ranking', ['rankArray' => $rankArray, 'userRank' => $userRank]);
23
    }
24
}
25