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.

Character   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 68
Duplicated Lines 13.24 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 8
c 0
b 0
f 0
lcom 2
cbo 2
dl 9
loc 68
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCodepoint() 0 4 1
A getCodepointValue() 0 4 1
A getProperties() 0 4 1
A getGeneralProperties() 0 4 1
A equals() 9 9 3

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 UCD\Unicode;
4
5
use UCD\Unicode\Codepoint;
6
use UCD\Unicode\Character\Properties;
7
8
class Character implements CodepointAssigned, Comparable
9
{
10
    /**
11
     * @var Codepoint
12
     */
13
    private $codepoint;
14
15
    /**
16
     * @var Properties
17
     */
18
    private $properties;
19
20
    /**
21
     * @param Codepoint $codepoint
22
     * @param Properties $properties
23
     */
24
    public function __construct(Codepoint $codepoint, Properties $properties)
25
    {
26
        $this->codepoint = $codepoint;
27
        $this->properties = $properties;
28
    }
29
30
    /**
31
     * @return Codepoint
32
     */
33
    public function getCodepoint()
34
    {
35
        return $this->codepoint;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getCodepointValue()
42
    {
43
        return $this->codepoint->getValue();
44
    }
45
46
    /**
47
     * @return Properties
48
     */
49
    public function getProperties()
50
    {
51
        return $this->properties;
52
    }
53
54
    /**
55
     * @return Properties\General
56
     */
57
    public function getGeneralProperties()
58
    {
59
        return $this->properties->getGeneral();
60
    }
61
62
    /**
63
     * @param mixed $other
64
     * @return bool
65
     */
66 View Code Duplication
    public function equals($other)
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...
67
    {
68
        if ($this === $other) {
69
            return true;
70
        }
71
72
        return $other instanceof self
73
            && $this->codepoint->equals($other->codepoint);
74
    }
75
}