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 (#24)
by Cees-Jan
11:37 queued 09:21
created

Commit   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 106
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 106
loc 106
ccs 10
cts 16
cp 0.625
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A sha() 4 4 1
A url() 4 4 1
A author() 4 4 1
A comitter() 4 4 1
A message() 4 4 1
A tree() 4 4 1
A commentCount() 4 4 1
A protectionUrl() 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 declare(strict_types=1);
2
3
namespace ApiClients\Client\Github\Resource\Git;
4
5
use ApiClients\Client\Github\Resource\TreeInterface;
6
use ApiClients\Foundation\Hydrator\Annotation\EmptyResource;
7
use ApiClients\Foundation\Hydrator\Annotation\Nested;
8
use ApiClients\Foundation\Resource\AbstractResource;
9
10
/**
11
 * @Nested(
12
 *     author="User",
13
 *     comitter="User",
14
 *     tree="Tree"
15
 * )
16
 * @EmptyResource("Git\EmptyCommit")
17
 */
18 View Code Duplication
abstract class Commit extends AbstractResource implements CommitInterface
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...
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $sha;
24
25
    /**
26
     * @var string
27
     */
28
    protected $url;
29
30
    /**
31
     * @var User
32
     */
33
    protected $author;
34
35
    /**
36
     * @var User
37
     */
38
    protected $comitter;
39
40
    /**
41
     * @var string
42
     */
43
    protected $message;
44
45
    /**
46
     * @var Tree
47
     */
48
    protected $tree;
49
50
    /**
51
     * @var int
52
     */
53
    protected $comment_count;
54
55
    /**
56
     * @var string
57
     */
58
    protected $protection_url;
59
60
    /**
61
     * @return string
62
     */
63 4
    public function sha(): string
64
    {
65 4
        return $this->sha;
66
    }
67
68
    /**
69
     * @return string
70
     */
71 4
    public function url(): string
72
    {
73 4
        return $this->url;
74
    }
75
76
    /**
77
     * @return User
78
     */
79
    public function author(): User
80
    {
81
        return $this->author;
82
    }
83
84
    /**
85
     * @return User
86
     */
87
    public function comitter(): User
88
    {
89
        return $this->comitter;
90
    }
91
92
    /**
93
     * @return string
94
     */
95 4
    public function message(): string
96
    {
97 4
        return $this->message;
98
    }
99
100
    /**
101
     * @return TreeInterface
102
     */
103
    public function tree(): TreeInterface
104
    {
105
        return $this->tree;
106
    }
107
108
    /**
109
     * @return int
110
     */
111 4
    public function commentCount(): int
112
    {
113 4
        return $this->comment_count;
114
    }
115
116
    /**
117
     * @return string
118
     */
119 4
    public function protectionUrl(): string
120
    {
121 4
        return $this->protection_url;
122
    }
123
}
124