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.

PeriodicEndpoint   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 40
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildSpecificEntryUrl() 7 7 1
A buildListUrl() 6 6 1
A buildRecentUrl() 7 7 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 Choccybiccy\HumanApi\Endpoint;
4
5
use Choccybiccy\HumanApi\Endpoint;
6
7
/**
8
 * Class PeriodicEndpoint
9
 * @package Choccybiccy\HumanApi\Endpoint
10
 */
11 View Code Duplication
abstract class PeriodicEndpoint extends Endpoint
12
{
13
14
    /**
15
     * @var string
16
     */
17
    protected $plural = "summaries";
18
19
    /**
20
     * {@inheritDoc}
21
     */
22
    protected function buildSpecificEntryUrl($id)
23
    {
24
        return $this->buildUrlParts(array(
25
            $this->type,
26
            $id
27
        ));
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    protected function buildListUrl()
34
    {
35
        return $this->buildUrlParts(array(
36
            $this->type,
37
        ));
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    protected function buildRecentUrl()
44
    {
45
        return $this->buildUrlParts(array(
46
            $this->type,
47
            $this->plural,
48
        ));
49
    }
50
}
51