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 ( 352f99...e3c5ff )
by Cees-Jan
09:24
created

Build   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%
Metric Value
wmc 5
lcom 0
cbo 2
dl 45
loc 45
ccs 0
cts 13
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A getRequest() 4 4 1
A fromResponse() 4 4 1
A getId() 4 4 1
A matrix() 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 WyriHaximus\Travis;
4
5
use Psr\Http\Message\RequestInterface;
6
use Psr\Http\Message\ResponseInterface;
7
8 View Code Duplication
class Build implements EndpointInterface
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...
9
{
10
    use ParentHasClientAwareTrait;
11
12
    /**
13
     * @var Repository
14
     */
15
    protected $repository;
16
17
    /**
18
     * @var int
19
     */
20
    protected $id;
21
22
    public function __construct(Repository $repository, \stdClass $build)
23
    {
24
        $this->setParent($repository);
25
        $this->repository = $repository;
26
27
        $this->id = $build->id;
28
    }
29
30
    public function getRequest(): RequestInterface
31
    {
32
        // TODO: Implement getRequest() method.
33
    }
34
35
    public function fromResponse(ResponseInterface $response): EndpointInterface
36
    {
37
        // TODO: Implement fromResponse() method.
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getId(): int
44
    {
45
        return $this->id;
46
    }
47
48
    public function matrix()
49
    {
50
        return new BuildMatrix($this);
51
    }
52
}
53