Completed
Pull Request — develop (#25)
by
unknown
05:29 queued 03:40
created

NumericBoost   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 75
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 0
cbo 0
dl 75
loc 75
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 4 4 1
A setName() 5 5 1
A isInverted() 4 4 1
A setInverted() 5 5 1
A getStrength() 4 4 1
A setStrength() 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\Request;
4
5
use JMS\Serializer\Annotation as JMS;
6
7 View Code Duplication
class NumericBoost
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...
8
{
9
  /**
10
   * @var string
11
   * @JMS\Type("string")
12
   */
13
  private $name;
14
15
  /**
16
   * @var boolean
17
   * @JMS\Type("boolean")
18
   */
19
  private $inverted;
20
21
  /**
22
   * @var double
23
   * @JMS\Type("double")
24
   */
25
  private $strength = 1.0;
26
27
  /**
28
   * @return string The name of this Numeric Boost
29
   */
30
  public function getName()
31
  {
32
    return $this->name;
33
  }
34
35
  /**
36
   * @param $name    string to be the name of this Numeric Boost
37
   * @return        NumericBoost
38
   */
39
  public function setName($name)
40
  {
41
    $this->name = $name;
42
    return $this;
43
  }
44
45
  /**
46
   * @return boolean Whether this is an inverted Numeric Boost
47
   */
48
  public function isInverted()
49
  {
50
    return $this->inverted;
51
  }
52
53
  /**
54
   * @param $inverted    boolean True if this is to be an iverted Numeric Boost, false otherwise
55
   * @return            NumericBoost
56
   */
57
  public function setInverted($inverted)
58
  {
59
    $this->inverted = $inverted;
60
    return $this;
61
  }
62
63
  /**
64
   * @return double The strength of this Numeric Boost
65
   */
66
  public function getStrength()
67
  {
68
    return $this->strength;
69
  }
70
71
  /**
72
   * @param $strength  double value to be the strength of this Numeric Boost
73
   * @return        NumericBoost
74
   */
75
  public function setStrength($strength)
76
  {
77
    $this->strength = $strength;
78
    return $this;
79
  }
80
81
}