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 ( b71509...a4a6e2 )
by Cees-Jan
07:54
created

File   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 158
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 12
lcom 0
cbo 1
dl 158
loc 158
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A type() 4 4 1
A encoding() 4 4 1
A size() 4 4 1
A name() 4 4 1
A path() 4 4 1
A content() 4 4 1
A sha() 4 4 1
A url() 4 4 1
A gitUrl() 4 4 1
A htmlUrl() 4 4 1
A downloadUrl() 4 4 1
A links() 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\Contents;
4
5
use ApiClients\Foundation\Hydrator\Annotations\EmptyResource;
6
use ApiClients\Foundation\Hydrator\Annotations\Nested;
7
use ApiClients\Foundation\Resource\AbstractResource;
8
9
/**
10
 * @Nested(
11
 *     _links="Contents\Links"
12
 * )
13
 * @EmptyResource("Contents\EmptyFile")
14
 */
15 View Code Duplication
abstract class File extends AbstractResource implements FileInterface
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...
16
{
17
    /**
18
     * @var string
19
     */
20
    protected $type;
21
22
    /**
23
     * @var string
24
     */
25
    protected $encoding;
26
27
    /**
28
     * @var int
29
     */
30
    protected $size;
31
32
    /**
33
     * @var string
34
     */
35
    protected $name;
36
37
    /**
38
     * @var string
39
     */
40
    protected $path;
41
42
    /**
43
     * @var string
44
     */
45
    protected $content;
46
47
    /**
48
     * @var string
49
     */
50
    protected $sha;
51
52
    /**
53
     * @var string
54
     */
55
    protected $url;
56
57
    /**
58
     * @var string
59
     */
60
    protected $git_url;
61
62
    /**
63
     * @var string
64
     */
65
    protected $html_url;
66
67
    /**
68
     * @var string
69
     */
70
    protected $download_url;
71
72
    /**
73
     * @var Contents\Links
74
     */
75
    protected $_links;
76
77
    /**
78
     * @return string
79
     */
80
    public function type() : string
81
    {
82
        return $this->type;
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    public function encoding() : string
89
    {
90
        return $this->encoding;
91
    }
92
93
    /**
94
     * @return int
95
     */
96
    public function size() : int
97
    {
98
        return $this->size;
99
    }
100
101
    /**
102
     * @return string
103
     */
104
    public function name() : string
105
    {
106
        return $this->name;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function path() : string
113
    {
114
        return $this->path;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function content() : string
121
    {
122
        return $this->content;
123
    }
124
125
    /**
126
     * @return string
127
     */
128
    public function sha() : string
129
    {
130
        return $this->sha;
131
    }
132
133
    /**
134
     * @return string
135
     */
136
    public function url() : string
137
    {
138
        return $this->url;
139
    }
140
141
    /**
142
     * @return string
143
     */
144
    public function gitUrl() : string
145
    {
146
        return $this->git_url;
147
    }
148
149
    /**
150
     * @return string
151
     */
152
    public function htmlUrl() : string
153
    {
154
        return $this->html_url;
155
    }
156
157
    /**
158
     * @return string
159
     */
160
    public function downloadUrl() : string
161
    {
162
        return $this->download_url;
163
    }
164
165
    /**
166
     * @return Contents\Links
167
     */
168
    public function links() : Contents\Links
169
    {
170
        return $this->_links;
171
    }
172
}
173