DojoController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 9 2
1
<?php
2
namespace App\Http\Controllers;
3
4
use App\Models\Eloquent\Dojo\DojoPhase;
5
use App\Http\Controllers\Controller;
6
use Illuminate\Http\Request;
7
use Auth;
8
9
class DojoController extends Controller
10
{
11
    /**
12
     * Show the Rank Page.
13
     *
14
     * @param Request $request your web request
15
     *
16
     * @return Response
0 ignored issues
show
Bug introduced by
The type App\Http\Controllers\Response was not found. Did you mean Response? If so, make sure to prefix the type with \.
Loading history...
17
     */
18
    public function index(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

18
    public function index(/** @scrutinizer ignore-unused */ Request $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        $status = Auth::check() ? Auth::user()->getDojoStatistics() : false;
0 ignored issues
show
Bug introduced by
The method getDojoStatistics() does not exist on Illuminate\Contracts\Auth\Authenticatable. It seems like you code against a sub-type of said class. However, the method does not exist in Illuminate\Auth\GenericUser. Are you sure you never get one of those? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $status = Auth::check() ? Auth::user()->/** @scrutinizer ignore-call */ getDojoStatistics() : false;
Loading history...
21
        return view('dojo.index', [
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('dojo.index'..., 'status' => $status)) returns the type Illuminate\View\View which is incompatible with the documented return type App\Http\Controllers\Response.
Loading history...
22
            'page_title' => "Dojo",
23
            'site_title' => config("app.name"),
24
            'navigation' => "Dojo",
25
            'phases' => DojoPhase::all()->sortBy('order'),
26
            'status' => $status,
27
        ]);
28
    }
29
}
30