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 ( f20fbc...7f6b56 )
by Oleg
02:14
created

CommunityOAuth   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 37.04 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUser() 10 10 2

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 BlizzardApi\Service;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\Psr7\Response;
7
8
/**
9
 * Class CommunityOAuth
10
 *
11
 * @author Oleg Kachinsky <[email protected]>
12
 */
13
class CommunityOAuth extends Service
14
{
15
    // region Account API
16
17
    /**
18
     * Get user
19
     *
20
     * Returns the account information of a user
21
     *
22
     * @param null|string $accessToken Authorized user access token
23
     * @param array       $options     Options
24
     *
25
     * @return Response
26
     */
27 View Code Duplication
    public function getUser($accessToken = null, array $options = [])
0 ignored issues
show
Duplication introduced by
This method 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...
28
    {
29
        if (null === $accessToken) {
30
            $options['access_token'] = $this->blizzardClient->getAccessToken();
31
        } else {
32
            $options['access_token'] = $accessToken;
33
        }
34
35
        return $this->request('/account/user', $options);
36
    }
37
38
    // endregion Account API
39
}
40