Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Failed
Pull Request — development (#48)
by José
06:52
created

AccountController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
B userInfo() 0 24 2
A updateProfile() 0 4 1
1
<?php
2
3
namespace DoeSangue\Http\Controllers\API\V1\User;
4
5
use JWTAuth;
6
use Illuminate\Http\Request;
7
use DoeSangue\Http\Controllers\Controller;
8
9
class AccountController extends Controller
10
{
11
    /**
12
     * Get Logged in User information.
13
     *
14
     * @return \Illuminate\Http\JsonResponse
15
     */
16
    public function userInfo()
17
    {
18
        $user = JWTAuth::parseToken()->authenticate();
19
20
        // If the token is invalid
21
        if (!$user) {
22
            return response()->json([ 'invalid_user' ], 401);
23
        }
24
        // Return the user data in json.
25
        return response()->json(
26
            [
27
            'first_name' =>   $user->first_name,
28
            'last_name'  =>   $user->last_name,
29
            'email'      =>   $user->email,
30
            'username'   =>   $user->username,
31
            'blood_type' =>   $user->donor->bloodType->code,
32
            'avatar'     =>   '', //$user->avatar,
33
            'birthdate'  =>   $user->birthdate,
34
            'phone'      =>   $user->phone,
35
            'bio'        =>   $user->bio
36
            ], 200
37
        );
38
39
    }
40
41
    public function updateProfile(Request $data)
0 ignored issues
show
Unused Code introduced by
The parameter $data 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...
42
    {
43
        //
44
    }
45
}
46