HuasoFoundries/jpgraph

View on GitHub
src/plot/Gradient.php

Summary

Maintainability
F
1 wk
Test Coverage

Method FilledRectangle has 247 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
    {
        $this->img->SetLineWeight(1);
        switch ($style) {
            case GRAD_VER:
Severity: Major
Found in src/plot/Gradient.php - About 1 day to fix

    Function FilledRectangle has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
        {
            $this->img->SetLineWeight(1);
            switch ($style) {
                case GRAD_VER:
    Severity: Minor
    Found in src/plot/Gradient.php - About 7 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File Gradient.php has 349 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * JPGraph v4.0.3
     */
    Severity: Minor
    Found in src/plot/Gradient.php - About 4 hrs to fix

      The class Gradient has an overall complexity of 79 which is very high. The configured complexity threshold is 50.
      Open

      class Gradient
      {
          private $img;
          private $numcolors = 100;
      
      
      Severity: Minor
      Found in src/plot/Gradient.php by phpmd

      Function FilledFlatPolygon has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public function FilledFlatPolygon($pts, $from_color, $to_color)
          {
              if (safe_count($pts) == 0) {
                  return;
              }
      Severity: Minor
      Found in src/plot/Gradient.php - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method FilledFlatPolygon has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function FilledFlatPolygon($pts, $from_color, $to_color)
          {
              if (safe_count($pts) == 0) {
                  return;
              }
      Severity: Minor
      Found in src/plot/Gradient.php - About 2 hrs to fix

        Method GetColArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function GetColArray($from_color, $to_color, $arr_size, &$colors, $numcols = 100)
            {
                if ($arr_size == 0) {
                    return;
                }
        Severity: Minor
        Found in src/plot/Gradient.php - About 1 hr to fix

          Method FilledRectangle has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
          Severity: Major
          Found in src/plot/Gradient.php - About 50 mins to fix

            Method GetColArray has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function GetColArray($from_color, $to_color, $arr_size, &$colors, $numcols = 100)
            Severity: Minor
            Found in src/plot/Gradient.php - About 35 mins to fix

              The method FilledRectangle() has 280 lines of code. Current threshold is set to 100. Avoid really long methods.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
                  {
                      $this->img->SetLineWeight(1);
                      switch ($style) {
                          case GRAD_VER:
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              The method FilledRectangle() has an NPath complexity of 209. The configured NPath complexity threshold is 200.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
                  {
                      $this->img->SetLineWeight(1);
                      switch ($style) {
                          case GRAD_VER:
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              NPathComplexity

              Since: 0.1

              The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

              Example

              class Foo {
                  function bar() {
                      // lots of complicated code
                  }
              }

              Source https://phpmd.org/rules/codesize.html#npathcomplexity

              The method FilledRectangle() has a Cyclomatic Complexity of 63. The configured cyclomatic complexity threshold is 10.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
                  {
                      $this->img->SetLineWeight(1);
                      switch ($style) {
                          case GRAD_VER:
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

              The method FilledFlatPolygon() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
              Open

                  public function FilledFlatPolygon($pts, $from_color, $to_color)
                  {
                      if (safe_count($pts) == 0) {
                          return;
                      }
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $firststep, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $steps1, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                      $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($to_color, $from_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colmap' which will lead to PHP notices.
              Open

                          $colmap[$i] = $colors[$idx++];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($to_color, $from_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                      $this->img->current_color = $colors[$steps + $i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colmap' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colmap[$y];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $n  = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color2, $to_color, $steps1, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($to_color, $from_color, $steps1, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$j];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->GetColArray($from_color, $to_color, $firststep, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colmap' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colmap[$y];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                  $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                              $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                      $this->img->current_color = $colors[$i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colors' which will lead to PHP notices.
              Open

                                      $this->img->current_color = $colors[$steps + $i];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              Avoid using undefined variables such as '$colmap' which will lead to PHP notices.
              Open

                              $this->img->current_color = $colmap[$yy];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UndefinedVariable

              Since: 2.8.0

              Detects when a variable is used that has not been defined before.

              Example

              class Foo
              {
                  private function bar()
                  {
                      // $message is undefined
                      echo $message;
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#undefinedvariable

              The method FilledFlatPolygon uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              while ($y >= $p1[1]) {
                                  $x2                       = $p2[0] + $slope * ($start - $y);
                                  $this->img->current_color = $colmap[$y];
                                  $this->img->Line($x1, $y, $x2, $y);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'FilledRectangle'.
              Open

                              Util\JpGraphError::RaiseL(7001, $style);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method FilledRectangle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                              } else {
                                  // height is greater than width -> use y-dimension for steps
                                  $steps = $yb - $yt;
                                  $delta = $yb >= $yt ? 1 : -1;
                                  $this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method GetColArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $r     = floor($from_color[0] + $colnum * $rdelta);
                              $g     = floor($from_color[1] + $colnum * $gdelta);
                              $b     = floor($from_color[2] + $colnum * $bdelta);
                              $alpha = $from_alpha + $colnum * $adelta;
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid unused local variables such as '$x'.
              Open

                          $x    = round($pts[$i]);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              UnusedLocalVariable

              Since: 0.2

              Detects when a local variable is declared and/or assigned, but not used.

              Example

              class Foo {
                  public function doSomething()
                  {
                      $i = 5; // Unused
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          case GRAD_WIDE_MIDHOR:
                              $diff      = ceil(abs($yb - $yt));
                              $steps     = floor(abs($diff) / 3);
                              $firststep = $diff - 2 * $steps;
                              $delta     = $yb >= $yt ? 1 : -1;
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 1 day to fix
              src/plot/Gradient.php on lines 130..154

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 308.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          case GRAD_WIDE_MIDVER:
                              $diff      = ceil(abs($xr - $xl));
                              $steps     = floor(abs($diff) / 3);
                              $firststep = $diff - 2 * $steps;
                              $delta     = $xr >= $xl ? 1 : -1;
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 1 day to fix
              src/plot/Gradient.php on lines 155..178

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 308.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              if ($xr - $xl > $yb - $yt) {
                                  // width is greater than height -> use x-dimension for steps
                                  $steps = $xr - $xl;
                                  $delta = $xr >= $xl ? 1 : -1;
                                  $this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 1 day to fix
              src/plot/Gradient.php on lines 313..333

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 276.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              } else {
                                  // height is greater than width -> use y-dimension for steps
                                  $steps = $yb - $yt;
                                  $delta = $yb >= $yt ? 1 : -1;
                                  $this->GetColArray($from_color, $to_color, $steps * 2, $colors, $this->numcolors);
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 1 day to fix
              src/plot/Gradient.php on lines 293..333

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 276.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          case GRAD_MIDVER:
                              $steps = ceil(abs($xr - $xl) / 2);
                              $delta = $xr >= $xl ? 1 : -1;
                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
                              for ($x = $xl, $i = 0; $i < $steps; ++$i) {
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 1 day to fix
              src/plot/Gradient.php on lines 88..108

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 261.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          case GRAD_MIDHOR:
                              $steps = ceil(abs($yb - $yt) / 2);
                              $delta = $yb >= $yt ? 1 : -1;
                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
                              for ($y = $yt, $i = 0; $i < $steps; ++$i) {
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 1 day to fix
              src/plot/Gradient.php on lines 109..129

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 261.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          case GRAD_HOR:
                              $steps = ceil(abs($yb - $yt) + 1);
                              $delta = $yb >= $yt ? 1 : -1;
                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
                              for ($i = 0, $y = $yt; $i < $steps; ++$i) {
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 3 hrs to fix
              src/plot/Gradient.php on lines 66..76

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 144.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          case GRAD_VER:
                              $steps = ceil(abs($xr - $xl) + 1);
                              $delta = $xr >= $xl ? 1 : -1;
                              $this->GetColArray($from_color, $to_color, $steps, $colors, $this->numcolors);
                              for ($i = 0, $x = $xl; $i < $steps; ++$i) {
              Severity: Major
              Found in src/plot/Gradient.php and 1 other location - About 3 hrs to fix
              src/plot/Gradient.php on lines 77..87

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 144.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Avoid variables with short names like $dx. Configured minimum length is 3.
              Open

                              $dx = ($xr - $xl) / 2;
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $y2. Configured minimum length is 3.
              Open

                              $y2 = $yb;
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $xl. Configured minimum length is 3.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $dy. Configured minimum length is 3.
              Open

                              $dy = ($yb - $yt) / 2;
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $g. Configured minimum length is 3.
              Open

                              $g     = floor($from_color[1] + $colnum * $gdelta);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $b. Configured minimum length is 3.
              Open

                              $b     = floor($from_color[2] + $colnum * $bdelta);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $p1. Configured minimum length is 3.
              Open

                          $p1 = [round($pts[$idx * 2]), round($pts[$idx * 2 + 1])];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $m. Configured minimum length is 3.
              Open

                              $m           = ($adj - 1.0) * (255 - min(255, min($from_color[0], min($from_color[1], $from_color[2]))));
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $y. Configured minimum length is 3.
              Open

                          $y    = round($pts[$i + 1]);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $n. Configured minimum length is 3.
              Open

                              $n = safe_count($colors);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $r. Configured minimum length is 3.
              Open

                              $r     = floor($from_color[0] + $colnum * $rdelta);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $x1. Configured minimum length is 3.
              Open

                          $x1    = $p1[0];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $yt. Configured minimum length is 3.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $yb. Configured minimum length is 3.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $p2. Configured minimum length is 3.
              Open

                          $p2 = [round($pts[++$idx * 2]), round($pts[$idx * 2 + 1])];
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $xr. Configured minimum length is 3.
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $x2. Configured minimum length is 3.
              Open

                              $x2 = $xr;
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $n. Configured minimum length is 3.
              Open

                      $n    = safe_count($pts);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $x. Configured minimum length is 3.
              Open

                          $x    = round($pts[$i]);
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $x2. Configured minimum length is 3.
              Open

                          $x2    = $p2[0] - 1;
              Severity: Minor
              Found in src/plot/Gradient.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Method name "Gradient::GetColArray" is not in camel caps format
              Open

                  public function GetColArray($from_color, $to_color, $arr_size, &$colors, $numcols = 100)
              Severity: Minor
              Found in src/plot/Gradient.php by phpcodesniffer

              Method name "Gradient::FilledRectangle" is not in camel caps format
              Open

                  public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
              Severity: Minor
              Found in src/plot/Gradient.php by phpcodesniffer

              Method name "Gradient::SetNumColors" is not in camel caps format
              Open

                  public function SetNumColors($aNum)
              Severity: Minor
              Found in src/plot/Gradient.php by phpcodesniffer

              Method name "Gradient::FilledFlatPolygon" is not in camel caps format
              Open

                  public function FilledFlatPolygon($pts, $from_color, $to_color)
              Severity: Minor
              Found in src/plot/Gradient.php by phpcodesniffer

              Line exceeds 120 characters; contains 121 characters
              Open

                              $m           = ($adj - 1.0) * (255 - min(255, min($from_color[0], min($from_color[1], $from_color[2]))));
              Severity: Minor
              Found in src/plot/Gradient.php by phpcodesniffer

              There are no issues that match your filters.

              Category
              Status