HuasoFoundries/jpgraph

View on GitHub
src/plot/Plot.php

Summary

Maintainability
B
6 hrs
Test Coverage

The class Plot has 12 public methods. Consider refactoring Plot to keep number of public methods under 10.
Open

class Plot
{
    public $numpoints = 0;
    public $value;
    public $legend         = '';
Severity: Minor
Found in src/plot/Plot.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

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

Function Max has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function Max()
    {
        if (isset($this->coords[1])) {
            $x = $this->coords[1];
        } else {
Severity: Minor
Found in src/plot/Plot.php - About 1 hr 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

Function Min has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function Min()
    {
        if (isset($this->coords[1])) {
            $x = $this->coords[1];
        } else {
Severity: Minor
Found in src/plot/Plot.php - About 1 hr 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

The class Plot has 18 fields. Consider redesigning Plot to keep the number of fields under 15.
Open

class Plot
{
    public $numpoints = 0;
    public $value;
    public $legend         = '';
Severity: Minor
Found in src/plot/Plot.php by phpmd

TooManyFields

Since: 0.1

Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

Example

class Person {
   protected $one;
   private $two;
   private $three;
   [... many more fields ...]
}

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

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

    public function Max()
    {
        if (isset($this->coords[1])) {
            $x = $this->coords[1];
        } else {
Severity: Minor
Found in src/plot/Plot.php - About 1 hr to fix

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

        public function Min()
        {
            if (isset($this->coords[1])) {
                $x = $this->coords[1];
            } else {
    Severity: Minor
    Found in src/plot/Plot.php - About 1 hr to fix

      Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct($aDatay, $aDatax = false)
          {
              $this->numpoints = safe_count($aDatay);
              if ($this->numpoints == 0) {
                  Util\JpGraphError::RaiseL(25121); //("Empty input data array specified for plot. Must have at least one data point.");
      Severity: Minor
      Found in src/plot/Plot.php - About 45 mins 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

      The method __construct has a boolean flag argument $aDatax, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function __construct($aDatay, $aDatax = false)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

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

      The method HideLegend has a boolean flag argument $f, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function HideLegend($f = true)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

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

      The method SetCenter has a boolean flag argument $aCenter, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function SetCenter($aCenter = true)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

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

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

              } else {
                  $ym = '';
              }
      Severity: Minor
      Found in src/plot/Plot.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 Min uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $xm = 0;
              }
      Severity: Minor
      Found in src/plot/Plot.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 Max uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $xm = $this->numpoints - 1;
              }
      Severity: Minor
      Found in src/plot/Plot.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 'Stroke'.
      Open

              Util\JpGraphError::RaiseL(25122); //("JpGraph: Stroke() must be implemented by concrete subclass to class Plot");
      Severity: Minor
      Found in src/plot/Plot.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

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

                  Util\JpGraphError::RaiseL(25121); //("Empty input data array specified for plot. Must have at least one data point.");
      Severity: Minor
      Found in src/plot/Plot.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

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

                          Util\JpGraphError::RaiseL(25070);
      Severity: Minor
      Found in src/plot/Plot.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 Max uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $x = '';
              }
      Severity: Minor
      Found in src/plot/Plot.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 Min uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $x = '';
              }
      Severity: Minor
      Found in src/plot/Plot.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 'PreStrokeAdjust'.
      Open

                  Util\JpGraphError::RaiseL(25123); //("JpGraph: You can't use a text X-scale with specified X-coords. Use a \"int\" or \"lin\" scale instead.");
      Severity: Minor
      Found in src/plot/Plot.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 Max uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $ym = '';
              }
      Severity: Minor
      Found in src/plot/Plot.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 parameters such as '$aImg'.
      Open

          public function Stroke($aImg, $aXScale, $aYScale)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

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

      Avoid unused parameters such as '$aXScale'.
      Open

          public function Stroke($aImg, $aXScale, $aYScale)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

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

      Avoid unused parameters such as '$aImg'.
      Open

          public function StrokeMargin($aImg)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

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

      Avoid unused parameters such as '$aYScale'.
      Open

          public function Stroke($aImg, $aXScale, $aYScale)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

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

      Avoid unused parameters such as '$aGraph'.
      Open

          public function PreScaleSetup($aGraph)
      Severity: Minor
      Found in src/plot/Plot.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

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

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 17 and the first side effect is on line 9.
      Open

      <?php
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

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

                  $x = $this->coords[1];
      Severity: Minor
      Found in src/plot/Plot.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 $xm. Configured minimum length is 3.
      Open

                  $xm = min($x);
      Severity: Minor
      Found in src/plot/Plot.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 $i. Configured minimum length is 3.
      Open

                  $i = 0;
      Severity: Minor
      Found in src/plot/Plot.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 $xm. Configured minimum length is 3.
      Open

                  $xm = max($x);
      Severity: Minor
      Found in src/plot/Plot.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 = $this->coords[1];
      Severity: Minor
      Found in src/plot/Plot.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($aDatax);
      Severity: Minor
      Found in src/plot/Plot.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

          public function StrokeDataValue($img, $aVal, $x, $y)
      Severity: Minor
      Found in src/plot/Plot.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 = $this->coords[0];
      Severity: Minor
      Found in src/plot/Plot.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 $i. Configured minimum length is 3.
      Open

                  $i   = 0;
      Severity: Minor
      Found in src/plot/Plot.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

          public function StrokeDataValue($img, $aVal, $x, $y)
      Severity: Minor
      Found in src/plot/Plot.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 $f. Configured minimum length is 3.
      Open

          public function HideLegend($f = true)
      Severity: Minor
      Found in src/plot/Plot.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 $ym. Configured minimum length is 3.
      Open

                  while ($i < $cnt && !is_numeric($ym = $y[$i])) {
      Severity: Minor
      Found in src/plot/Plot.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   = $this->coords[0];
      Severity: Minor
      Found in src/plot/Plot.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 $ym. Configured minimum length is 3.
      Open

                  while ($i < $cnt && !is_numeric($ym = $y[$i])) {
      Severity: Minor
      Found in src/plot/Plot.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 "Plot::Min" is not in camel caps format
      Open

          public function Min()
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::PreStrokeAdjust" is not in camel caps format
      Open

          public function PreStrokeAdjust($aGraph)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::Clear" is not in camel caps format
      Open

          public function Clear()
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::Stroke" is not in camel caps format
      Open

          public function Stroke($aImg, $aXScale, $aYScale)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::SetLegend" is not in camel caps format
      Open

          public function SetLegend($aLegend, $aCSIM = '', $aCSIMAlt = '', $aCSIMWinTarget = '')
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::GetCSIMareas" is not in camel caps format
      Open

          public function GetCSIMareas()
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::SetColor" is not in camel caps format
      Open

          public function SetColor($aColor)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::SetCenter" is not in camel caps format
      Open

          public function SetCenter($aCenter = true)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::Legend" is not in camel caps format
      Open

          public function Legend($aGraph)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::StrokeMargin" is not in camel caps format
      Open

          public function StrokeMargin($aImg)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::DoLegend" is not in camel caps format
      Open

          public function DoLegend($graph)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::PreScaleSetup" is not in camel caps format
      Open

          public function PreScaleSetup($aGraph)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::Max" is not in camel caps format
      Open

          public function Max()
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::SetWeight" is not in camel caps format
      Open

          public function SetWeight($aWeight)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::StrokeDataValue" is not in camel caps format
      Open

          public function StrokeDataValue($img, $aVal, $x, $y)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::SetCSIMTargets" is not in camel caps format
      Open

          public function SetCSIMTargets($aTargets, $aAlts = '', $aWinTargets = '')
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::SetLineWeight" is not in camel caps format
      Open

          public function SetLineWeight($aWeight = 1)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Method name "Plot::HideLegend" is not in camel caps format
      Open

          public function HideLegend($f = true)
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Line exceeds 120 characters; contains 130 characters
      Open

                  Util\JpGraphError::RaiseL(25121); //("Empty input data array specified for plot. Must have at least one data point.");
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Line exceeds 120 characters; contains 144 characters
      Open

                  $aGraph->legend->Add($this->legend, $this->color, '', 0, $this->legendcsimtarget, $this->legendcsimalt, $this->legendcsimwintarget);
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Line exceeds 120 characters; contains 121 characters
      Open

              Util\JpGraphError::RaiseL(25122); //("JpGraph: Stroke() must be implemented by concrete subclass to class Plot");
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      Line exceeds 120 characters; contains 155 characters
      Open

                  Util\JpGraphError::RaiseL(25123); //("JpGraph: You can't use a text X-scale with specified X-coords. Use a \"int\" or \"lin\" scale instead.");
      Severity: Minor
      Found in src/plot/Plot.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status