DataSet   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 43
loc 43
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getLabel() 3 3 1
A getValues() 3 3 1
A getColor() 3 3 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 rtens\domin\delivery\web\renderers\charting\data;
3
4
use rtens\domin\parameters\Color;
5
6 View Code Duplication
class DataSet {
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...
7
8
    /** @var null|string */
9
    private $label;
10
11
    /** @var int[] */
12
    private $values = [];
13
14
    /** @var null|Color */
15
    private $color;
16
17
    /**
18
     * @param int[] $values
19
     * @param null|string $label
20
     * @param Color|null $color
21
     */
22
    public function __construct(array $values = [], $label = '', Color $color = null) {
23
        $this->label = $label;
24
        $this->values = $values;
25
        $this->color = $color;
26
    }
27
28
    /**
29
     * @return null|string
30
     */
31
    public function getLabel() {
32
        return $this->label;
33
    }
34
35
    /**
36
     * @return int[]
37
     */
38
    public function getValues() {
39
        return $this->values;
40
    }
41
42
    /**
43
     * @return null|Color
44
     */
45
    public function getColor() {
46
        return $this->color;
47
    }
48
}