Items   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDimensions() 4 4 1
A setDimensions() 5 5 1
A getMetrics() 4 4 1
A setMetrics() 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\Dimensions;
6
use Yandex\Common\Model;
7
8 View Code Duplication
class Items 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...
9
{
10
11
    protected $dimensions = null;
12
13
    protected $metrics = null;
14
15
    protected $mappingClasses = [
16
        'dimensions' => 'Yandex\Metrica\Stat\Models\Dimensions'
17
    ];
18
19
    protected $propNameMap = [];
20
21
    /**
22
     * Retrieve the dimensions property
23
     *
24
     * @return Dimensions|null
25
     */
26 7
    public function getDimensions()
27
    {
28 7
        return $this->dimensions;
29
    }
30
31
    /**
32
     * Set the dimensions property
33
     *
34
     * @param Dimensions $dimensions
35
     * @return $this
36
     */
37 7
    public function setDimensions($dimensions)
38
    {
39 7
        $this->dimensions = $dimensions;
40 7
        return $this;
41
    }
42
43
    /**
44
     * Retrieve the metrics property
45
     *
46
     * @return array|null
47
     */
48 9
    public function getMetrics()
49
    {
50 9
        return $this->metrics;
51
    }
52
53
    /**
54
     * Set the metrics property
55
     *
56
     * @param array $metrics
57
     * @return $this
58
     */
59 7
    public function setMetrics($metrics)
60
    {
61 7
        $this->metrics = $metrics;
62 7
        return $this;
63
    }
64
}
65