Completed
Push — develop ( 4585d6...f672ca )
by Neil
10:40
created

HomeController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 4
Bugs 1 Features 2
Metric Value
wmc 3
c 4
b 1
f 2
lcom 1
cbo 3
dl 17
loc 17
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 3 3 1
A index() 3 3 1
A about() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Dingo\Api\Http;
6
use Dingo\Api\Routing\Helpers;
7
use Illuminate\Http\Request;
8
9 View Code Duplication
class HomeController 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...
10
{
11
    use Helpers;
12
13
    public function __construct(Request $request) {
1 ignored issue
show
Unused Code introduced by
The parameter $request is not used and could be removed.

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

Loading history...
14
        $this->middleware('auth');
15
    }
16
17
    public function index() {
18
        return view('home');
19
    }
20
21
    public function about() {
22
        $versions = $this->api->be(auth()->user())->get('/api/info');
0 ignored issues
show
Bug introduced by
The method user() does not seem to exist on object<Illuminate\Contracts\Auth\Factory>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
        return view('general.about', ['versions'=>$versions]);
24
    }
25
}
26