Completed
Pull Request — master (#159)
by
unknown
09:00
created

DrillDownComparisonItems   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 82
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 6
c 3
b 1
f 1
lcom 0
cbo 1
dl 82
loc 82
ccs 15
cts 15
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getDimension() 4 4 1
A getMetrics() 4 4 1
A getExpand() 4 4 1
A setDimension() 5 5 1
A setMetrics() 5 5 1
A setExpand() 5 5 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 Yandex\Metrica\Stat\Models;
4
5
use Yandex\Metrica\Stat\Models\Dimension;
6
use Yandex\Metrica\Stat\Models\ComparisonMetrics;
7
use Yandex\Common\Model;
8
9 View Code Duplication
class DrillDownComparisonItems extends Model
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...
10
{
11
12
    protected $dimension = null;
13
14
    protected $metrics = null;
15
16
    protected $expand = null;
17
18
    protected $mappingClasses = [
19
        'dimension' => 'Yandex\Metrica\Stat\Models\Dimension',
20
        'metrics' => 'Yandex\Metrica\Stat\Models\ComparisonMetrics'
21
    ];
22
23
    protected $propNameMap = [];
24
25
    /**
26
     * Retrieve the dimension property
27
     *
28
     * @return Dimension|null
29
     */
30 2
    public function getDimension()
31
    {
32 2
        return $this->dimension;
33
    }
34
35
    /**
36
     * Set the dimension property
37
     *
38
     * @param Dimension $dimension
39
     * @return $this
40
     */
41 1
    public function setDimension($dimension)
42
    {
43 1
        $this->dimension = $dimension;
44 1
        return $this;
45
    }
46
47
    /**
48
     * Retrieve the metrics property
49
     *
50
     * @return ComparisonMetrics|null
51
     */
52 2
    public function getMetrics()
53
    {
54 2
        return $this->metrics;
55
    }
56
57
    /**
58
     * Set the metrics property
59
     *
60
     * @param ComparisonMetrics $metrics
61
     * @return $this
62
     */
63 1
    public function setMetrics($metrics)
64
    {
65 1
        $this->metrics = $metrics;
66 1
        return $this;
67
    }
68
69
    /**
70
     * Retrieve the expand property
71
     *
72
     * @return bool|null
73
     */
74 2
    public function getExpand()
75
    {
76 2
        return $this->expand;
77
    }
78
79
    /**
80
     * Set the expand property
81
     *
82
     * @param bool $expand
83
     * @return $this
84
     */
85 1
    public function setExpand($expand)
86
    {
87 1
        $this->expand = $expand;
88 1
        return $this;
89
    }
90
}
91