Passed
Push — master ( 948458...49e3d0 )
by Josh
01:11
created

TableMatch   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 10.45 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 5
c 3
b 0
f 1
lcom 0
cbo 0
dl 7
loc 67
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
/**
6
 * Class TableMatch
7
 * @package Caxy\HtmlDiff\Table
8
 */
9
class TableMatch
10
{
11
    /**
12
     * @var int
13
     */
14
    public $startInOld;
15
    /**
16
     * @var int
17
     */
18
    public $startInNew;
19
    /**
20
     * @var int
21
     */
22
    public $endInOld;
23
    /**
24
     * @var int
25
     */
26
    public $endInNew;
27
28
    /**
29
     * TableMatch constructor.
30
     *
31
     * @param int $startInOld
32
     * @param int $startInNew
33
     * @param int $endInOld
34
     * @param int $endInNew
35
     */
36 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...
37
    {
38
        $this->startInOld = $startInOld;
39
        $this->startInNew = $startInNew;
40
        $this->endInOld = $endInOld;
41
        $this->endInNew = $endInNew;
42
    }
43
44
    /**
45
     * @return int
46
     */
47
    public function getStartInOld()
48
    {
49
        return $this->startInOld;
50
    }
51
52
    /**
53
     * @return int
54
     */
55
    public function getStartInNew()
56
    {
57
        return $this->startInNew;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getEndInOld()
64
    {
65
        return $this->endInOld;
66
    }
67
68
    /**
69
     * @return int
70
     */
71
    public function getEndInNew()
72
    {
73
        return $this->endInNew;
74
    }
75
}
76