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 ( 3abaaf...dcd0c7 )
by Cees-Jan
8s
created

Build   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 81.82 %

Coupling/Cohesion

Components 1
Dependencies 7

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 7
dl 18
loc 22
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A jobs() 10 10 1
A job() 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
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis\Resource\Async;
5
6
use React\Promise\PromiseInterface;
7
use Rx\Observable;
8
use Rx\ObservableInterface;
9
use Rx\React\Promise;
10
use WyriHaximus\Travis\Resource\Build as BaseBuild;
11
use function React\Promise\resolve;
12
13
class Build extends BaseBuild
14
{
15 View Code Duplication
    public function jobs(): ObservableInterface
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...
16
    {
17
        return Promise::toObservable(
18
            $this->getTransport()->request('builds/' . $this->id())
19
        )->flatMap(function ($response) {
20
            return Observable::fromArray($response['jobs']);
21
        })->map(function ($job) {
22
            return $this->getTransport()->getHydrator()->hydrate('Job', $job);
23
        });
24
    }
25
26 View Code Duplication
    public function job(int $id): PromiseInterface
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...
27
    {
28
        return $this->getTransport()->request(
29
            'jobs/' . $id
30
        )->then(function ($response) {
31
            return resolve($this->getTransport()->getHydrator()->hydrate('Job', $response['job']));
32
        });
33
    }
34
}
35