Completed
Pull Request — develop (#20)
by
unknown
03:43 queued 01:54
created

Biasing   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 103
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 8
c 2
b 0
f 2
lcom 0
cbo 0
dl 103
loc 103
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getBringToTop() 4 4 1
A setBringToTop() 5 5 1
A isAugmentBiases() 4 4 1
A setAugmentBiases() 5 5 1
A getInfluence() 4 4 1
A setInfluence() 5 5 1
A getBiases() 4 4 1
A setBiases() 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 GroupByInc\API\Model;
4
5 View Code Duplication
class Biasing
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...
6
{
7
    /**
8
     * @var string[]
9
     */
10
    private $bringToTop = array();
11
12
    /**
13
     * @var bool
14
     */
15
    private $augmentBiases = false;
16
17
    /**
18
     * @var float|null
19
     */
20
    private $influence = null;
21
22
    /**
23
     * @var Bias[]
24
     */
25
    private $biases = array();
26
27
28
    /**
29
     * @return string[] The list of product IDs
30
     */
31
    public function getBringToTop()
32
    {
33
        return $this->bringToTop;
34
    }
35
36
    /**
37
     * A list of product IDs to bring to the top of the result set. This list
38
     * will ensure that the products are included in the result set and appear in the order
39
     * defined.
40
     *
41
     * @param string[] $bringToTop The list of productIds.
42
     *
43
     * @return Biasing
44
     */
45
    public function setBringToTop($bringToTop)
46
    {
47
        $this->bringToTop = $bringToTop;
48
        return $this;
49
    }
50
51
    /**
52
     * @return boolean
53
     */
54
    public function isAugmentBiases()
55
    {
56
        return $this->augmentBiases;
57
    }
58
59
    /**
60
     * @param boolean $augmentBiases
61
     *
62
     * @return Biasing
63
     */
64
    public function setAugmentBiases($augmentBiases)
65
    {
66
        $this->augmentBiases = $augmentBiases;
67
        return $this;
68
    }
69
70
    /**
71
     * @return float|null
72
     */
73
    public function getInfluence()
74
    {
75
        return $this->influence;
76
    }
77
78
    /**
79
     * @param float|null $influence
80
     *
81
     * @return Biasing
82
     */
83
    public function setInfluence($influence)
84
    {
85
        $this->influence = $influence;
86
        return $this;
87
    }
88
89
    /**
90
     * @return Bias[]
91
     */
92
    public function getBiases()
93
    {
94
        return $this->biases;
95
    }
96
97
    /**
98
     * @param Bias[] $biases
99
     *
100
     * @return Biasing
101
     */
102
    public function setBiases($biases)
103
    {
104
        $this->biases = $biases;
105
        return $this;
106
    }
107
}