Passed
Pull Request — master (#31)
by Josh
04:13
created

TableMatch   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 20 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 0
cbo 1
dl 7
loc 35
ccs 0
cts 14
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A getStartInOld() 0 4 1
A getStartInNew() 0 4 1
A getEndInOld() 0 4 1
A getEndInNew() 0 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
2
3
namespace Caxy\HtmlDiff\Table;
4
5
class TableMatch extends AbstractTableElement
6
{
7
    public $startInOld;
8
    public $startInNew;
9
    public $endInOld;
10
    public $endInNew;
11
12 View Code Duplication
    public function __construct($startInOld, $startInNew, $endInOld, $endInNew)
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...
13
    {
14
        $this->startInOld = $startInOld;
15
        $this->startInNew = $startInNew;
16
        $this->endInOld = $endInOld;
17
        $this->endInNew = $endInNew;
18
    }
19
20
    public function getStartInOld()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
21
    {
22
        return $this->startInOld;
23
    }
24
25
    public function getStartInNew()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
26
    {
27
        return $this->startInNew;
28
    }
29
30
    public function getEndInOld()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
31
    {
32
        return $this->endInOld;
33
    }
34
35
    public function getEndInNew()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
36
    {
37
        return $this->endInNew;
38
    }
39
}
40