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
Pull Request — master (#159)
by Roman
01:51
created

Assignment   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 23.53 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAliases() 8 8 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 declare(strict_types=1);
2
3
namespace OpenStack\Identity\v3\Models;
4
5
use OpenStack\Common\Resource\Alias;
6
use OpenStack\Common\Resource\OperatorResource;
7
use OpenStack\Common\Resource\Listable;
8
9
class Assignment extends OperatorResource implements Listable
10
{
11
    /** @var Role */
12
    public $role;
13
14
    /** @var array */
15
    public $scope;
16
17
    /** @var Group */
18
    public $group;
19
20
    /** @var User */
21
    public $user;
22
23
    protected $resourcesKey = 'role_assignments';
24
    protected $resourceKey = 'role_assignment';
25
26
    /**
27
     * @var array
28
     */
29
    protected $aliases = [];
30
31
    /**
32
     * @inheritdoc
33
     */
34 View Code Duplication
    protected function getAliases(): array
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...
35
    {
36
        $aliases = parent::getAliases();
37
        $aliases['role'] = new Alias('role', Role::class);
38
        $aliases['user'] = new Alias('user', User::class);
39
        $aliases['group'] = new Alias('group', Group::class);
40
        return $aliases;
41
    }
42
}
43