Input   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 55
loc 55
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A getMax() 4 4 1
A getRange() 4 4 1
A getSize() 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
namespace TildBJ\Seeder\Domain\Model\Column;
3
4
/***************************************************************
5
 *
6
 *  Copyright notice
7
 *
8
 *  (c) 2016 Dennis Römmich <[email protected]>
9
 *
10
 *  All rights reserved
11
 *
12
 *  This script is part of the TYPO3 project. The TYPO3 project is
13
 *  free software; you can redistribute it and/or modify
14
 *  it under the terms of the GNU General Public License as published by
15
 *  the Free Software Foundation; either version 3 of the License, or
16
 *  (at your option) any later version.
17
 *
18
 *  The GNU General Public License can be found at
19
 *  http://www.gnu.org/copyleft/gpl.html.
20
 *
21
 *  This script is distributed in the hope that it will be useful,
22
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 *  GNU General Public License for more details.
25
 *
26
 *  This copyright notice MUST APPEAR in all copies of the script!
27
 ***************************************************************/
28
use TildBJ\Seeder\Domain\Model\Column;
29
30
/**
31
 * Class Input
32
 *
33
 * @package TildBJ\Seeder\Domain\Model\Input
34
 */
35 View Code Duplication
class Input extends Column implements InputInterface
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...
36
{
37
    /**
38
     * @var string
39
     */
40
    protected $max;
41
42
    /**
43
     * @var array
44
     */
45
    protected $range;
46
47
    /**
48
     * @var int
49
     */
50
    protected $size;
51
52
    /**
53
     * Input constructor.
54
     *
55
     * @param string $columnName
56
     * @param $configuration
57
     */
58
    public function __construct($columnName, $configuration)
59
    {
60
        parent::__construct($columnName);
61
        $this->max = $configuration['max'];
62
        $this->range = $configuration['range'];
63
        $this->size = $configuration['size'];
64
    }
65
66
    /**
67
     * @return int
0 ignored issues
show
Documentation introduced by
Should the return type not be string?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
68
     */
69
    public function getMax()
70
    {
71
        return $this->max;
72
    }
73
74
    /**
75
     * @return array
76
     */
77
    public function getRange()
78
    {
79
        return $this->range;
80
    }
81
82
    /**
83
     * @return int
84
     */
85
    public function getSize()
86
    {
87
        return $this->size;
88
    }
89
}
90