WoodenTable   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 47
loc 47
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getWight() 4 4 1
A getHeight() 4 4 1
A getMaterial() 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
2
declare(strict_types=1);
3
4
namespace codenixsv\Patterns\Creational\AbstractFactory;
5
6
/**
7
 * Class WoodenTable
8
 * @package codenixsv\Patterns\Creational\AbstractFactory
9
 */
10 View Code Duplication
class WoodenTable implements TableInterface
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...
11
{
12
    /**
13
     * @var int
14
     */
15
    private $wight;
16
17
    /**
18
     * @var int
19
     */
20
    private $height;
21
22
    /**
23
     * WoodenTable constructor.
24
     * @param int $wight
25
     * @param int $height
26
     */
27 1
    public function __construct(int $wight, int $height)
28
    {
29 1
        $this->wight = $wight;
30 1
        $this->height = $height;
31 1
    }
32
33
    /**
34
     * @return int
35
     */
36 1
    public function getWight(): int
37
    {
38 1
        return $this->wight;
39
    }
40
41
    /**
42
     * @return int
43
     */
44 1
    public function getHeight(): int
45
    {
46 1
        return $this->height;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getMaterial(): string
53
    {
54
        return 'wood';
55
    }
56
}
57