HuasoFoundries/jpgraph

View on GitHub
src/util/DateScaleUtils.php

Summary

Maintainability
F
5 days
Test Coverage

Function doMonthly has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    public static function doMonthly($aType, $aMinor = false)
    {
        $monthcount = 0;
        $m          = self::$startmonth;
        $y          = self::$startyear;
Severity: Minor
Found in src/util/DateScaleUtils.php - About 6 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

Function doYearly has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public static function doYearly($aType, $aMinor = false)
    {
        $i = 0;
        $j = 0;
        $m = self::$startmonth;
Severity: Minor
Found in src/util/DateScaleUtils.php - About 4 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 DateScaleUtils.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * JPGraph v4.0.3
 */
Severity: Minor
Found in src/util/DateScaleUtils.php - About 3 hrs to fix

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

    class DateScaleUtils
    {
        public static $iMin = 0;
        public static $iMax = 0;
    
    
    Severity: Minor
    Found in src/util/DateScaleUtils.php by phpmd

    Method doMonthly has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function doMonthly($aType, $aMinor = false)
        {
            $monthcount = 0;
            $m          = self::$startmonth;
            $y          = self::$startyear;
    Severity: Major
    Found in src/util/DateScaleUtils.php - About 2 hrs to fix

      Function doDaily has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function doDaily($aType, $aMinor = false)
          {
              $m = self::$startmonth;
              $y = self::$startyear;
              $d = self::$startday;
      Severity: Minor
      Found in src/util/DateScaleUtils.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 doYearly has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function doYearly($aType, $aMinor = false)
          {
              $i = 0;
              $j = 0;
              $m = self::$startmonth;
      Severity: Minor
      Found in src/util/DateScaleUtils.php - About 2 hrs to fix

        Method doDaily has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function doDaily($aType, $aMinor = false)
            {
                $m = self::$startmonth;
                $y = self::$startyear;
                $d = self::$startday;
        Severity: Minor
        Found in src/util/DateScaleUtils.php - About 1 hr to fix

          Method doWeekly has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function doWeekly($aType, $aMinor = false)
              {
                  $hpd = 3600 * 24;
                  $hpw = 3600 * 24 * 7;
                  // Find out week number of min date
          Severity: Minor
          Found in src/util/DateScaleUtils.php - About 1 hr to fix

            Function doWeekly has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function doWeekly($aType, $aMinor = false)
                {
                    $hpd = 3600 * 24;
                    $hpw = 3600 * 24 * 7;
                    // Find out week number of min date
            Severity: Minor
            Found in src/util/DateScaleUtils.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 GetAutoTicks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function GetAutoTicks($aMin, $aMax, $aMaxTicks = 10, $aMinor = false)
                {
                    $diff = $aMax - $aMin;
                    $spd  = 3600 * 24;
                    $spw  = $spd * 7;
            Severity: Minor
            Found in src/util/DateScaleUtils.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

            Method GetAutoTicks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function GetAutoTicks($aMin, $aMax, $aMaxTicks = 10, $aMinor = false)
                {
                    $diff = $aMax - $aMin;
                    $spd  = 3600 * 24;
                    $spw  = $spd * 7;
            Severity: Minor
            Found in src/util/DateScaleUtils.php - About 1 hr to fix

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

                  public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
                  {
                      self::$starthour  = date('G', $aMin);
                      self::$startmonth = date('n', $aMin);
                      self::$startday   = date('j', $aMin);
              Severity: Minor
              Found in src/util/DateScaleUtils.php - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ($m <= $stopmonth) {
                                                if (!($y == self::$endyear && $m == $stopmonth && self::$endday < 15)) {
                                                    self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 15, $y);
                                                }
                                            }
                Severity: Major
                Found in src/util/DateScaleUtils.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (!($y == self::$endyear && $m > self::$endmonth)) {
                                                  self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                              }
                  Severity: Major
                  Found in src/util/DateScaleUtils.php - About 45 mins to fix

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

                        public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
                    Severity: Minor
                    Found in src/util/DateScaleUtils.php - About 35 mins to fix

                      Function GetTicksFromMinMax has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
                          {
                              self::$starthour  = date('G', $aMin);
                              self::$startmonth = date('n', $aMin);
                              self::$startday   = date('j', $aMin);
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php - About 35 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 doMonthly() has an NPath complexity of 936. The configured NPath complexity threshold is 200.
                      Open

                          public static function doMonthly($aType, $aMinor = false)
                          {
                              $monthcount = 0;
                              $m          = self::$startmonth;
                              $y          = self::$startyear;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doDaily() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                      Open

                          public static function doDaily($aType, $aMinor = false)
                          {
                              $m = self::$startmonth;
                              $y = self::$startyear;
                              $d = self::$startday;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doMonthly() has a Cyclomatic Complexity of 25. The configured cyclomatic complexity threshold is 10.
                      Open

                          public static function doMonthly($aType, $aMinor = false)
                          {
                              $monthcount = 0;
                              $m          = self::$startmonth;
                              $y          = self::$startyear;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doYearly() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
                      Open

                          public static function doYearly($aType, $aMinor = false)
                          {
                              $i = 0;
                              $j = 0;
                              $m = self::$startmonth;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$aData' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i++] = $aData[0];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$i' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i] = $aData[$n - 1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$tickPositions' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i++] = $aData[0];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$i' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i++] = $aData[0];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$aData' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i] = $aData[$n - 1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$n' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i] = $aData[$n - 1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$tickPositions' which will lead to PHP notices.
                      Open

                                  $tickPositions[$i] = $aData[$n - 1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doYearly has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function doYearly($aType, $aMinor = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 GetTicksFromMinMax has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doWeekly has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function doWeekly($aType, $aMinor = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 GetTicksFromMinMax has a boolean flag argument $aEndPoints, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doMonthly has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function doMonthly($aType, $aMinor = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doDaily has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function doDaily($aType, $aMinor = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 GetTicks has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function GetTicks($aData, $aType = 1, $aMinor = false, $aEndPoints = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 GetAutoTicks has a boolean flag argument $aMinor, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function GetAutoTicks($aMin, $aMax, $aMaxTicks = 10, $aMinor = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 GetTicks has a boolean flag argument $aEndPoints, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public static function GetTicks($aData, $aType = 1, $aMinor = false, $aEndPoints = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 doWeekly uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $t = mktime(0, 0, 0, $m, $d, $y) + $hpd * (8 - $daynumber);
                              }
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 GetAutoTicks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $w = 'd M';
                              }
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 'GetTicksFromMinMax'.
                      Open

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

                              } else {
                                  JpGraphError::RaiseL(24003);
                              }
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 '$week'.
                      Open

                              $week      = 1 + (date('z', $thursday) - (11 - date('w', mktime(0, 0, 0, 1, 1, date('Y', $thursday)))) % 7) / 7;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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

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

                                  $tickPositions[$i] = $aData[$n - 1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 DSUTILS_YEAR5:
                                      $y = self::$startyear;
                                      while ($y <= self::$endyear) {
                                          self::$tickPositions[$i++] = mktime(0, 0, 0, 1, 1, $y);
                                          for ($k = 0; $k < 4; ++$k) {
                      Severity: Major
                      Found in src/util/DateScaleUtils.php and 1 other location - About 2 hrs to fix
                      src/util/DateScaleUtils.php on lines 77..90

                      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 138.

                      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 DSUTILS_YEAR2:
                                      $y = self::$startyear;
                                      while ($y <= self::$endyear) {
                                          self::$tickPositions[$i++] = mktime(0, 0, 0, 1, 1, $y);
                                          for ($k = 0; $k < 1; ++$k) {
                      Severity: Major
                      Found in src/util/DateScaleUtils.php and 1 other location - About 2 hrs to fix
                      src/util/DateScaleUtils.php on lines 91..104

                      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 138.

                      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 3 locations. Consider refactoring.
                      Open

                                          case DSUTILS_MONTH3:
                                              if ($aMinor) {
                                                  // Set minor tick at start of each month
                                                  self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                              }
                      Severity: Major
                      Found in src/util/DateScaleUtils.php and 2 other locations - About 1 hr to fix
                      src/util/DateScaleUtils.php on lines 256..268
                      src/util/DateScaleUtils.php on lines 281..292

                      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 102.

                      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 3 locations. Consider refactoring.
                      Open

                                          case DSUTILS_MONTH6:
                                              if ($aMinor) {
                                                  // Set minor tick at start of each month
                                                  self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                              }
                      Severity: Major
                      Found in src/util/DateScaleUtils.php and 2 other locations - About 1 hr to fix
                      src/util/DateScaleUtils.php on lines 256..268
                      src/util/DateScaleUtils.php on lines 269..280

                      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 102.

                      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 3 locations. Consider refactoring.
                      Open

                                          case DSUTILS_MONTH2:
                                              if ($aMinor) {
                                                  // Set minor tick at start of each month
                                                  self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                              }
                      Severity: Major
                      Found in src/util/DateScaleUtils.php and 2 other locations - About 1 hr to fix
                      src/util/DateScaleUtils.php on lines 269..280
                      src/util/DateScaleUtils.php on lines 281..292

                      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 102.

                      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 $j. Configured minimum length is 3.
                      Open

                              $j = 0;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 = self::$startyear;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 = self::$startyear;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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          = self::$startyear;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 = self::$startyear;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $j. Configured minimum length is 3.
                      Open

                              $j = 0;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $t. Configured minimum length is 3.
                      Open

                                  $t                         = mktime(0, 0, 0, $m, $d, $y) + $hpw;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $w. Configured minimum length is 3.
                      Open

                                  $w = 'W';
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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/util/DateScaleUtils.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

                                  $tickPositions[$i] = $aData[$n - 1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $tt. Configured minimum length is 3.
                      Open

                              $tt = [
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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($t) / 3;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $fs. Configured minimum length is 3.
                      Open

                                              $fs                                     = $t[3 * $j + 2];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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

                                  $tickPositions[$i++] = $aData[0];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 = self::$startmonth;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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/util/DateScaleUtils.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/util/DateScaleUtils.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/util/DateScaleUtils.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 $t. Configured minimum length is 3.
                      Open

                                      $t = $tt[$i][1];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 = self::$startmonth;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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($aData);
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $d. Configured minimum length is 3.
                      Open

                              $d = self::$startday;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $t. Configured minimum length is 3.
                      Open

                              $t = mktime(0, 0, 0, $m, $d, $y);
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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          = self::$startmonth;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $j. Configured minimum length is 3.
                      Open

                              $j          = 0;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $nd. Configured minimum length is 3.
                      Open

                              $nd  = floor($diff / $spd);
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $h. Configured minimum length is 3.
                      Open

                              $h = self::$starthour;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 = self::$startmonth;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $d. Configured minimum length is 3.
                      Open

                              $d = self::$startday;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 $j. Configured minimum length is 3.
                      Open

                              $j = 0;
                      Severity: Minor
                      Found in src/util/DateScaleUtils.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 "DateScaleUtils::GetAutoTicks" is not in camel caps format
                      Open

                          public static function GetAutoTicks($aMin, $aMax, $aMaxTicks = 10, $aMinor = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Method name "DateScaleUtils::UseWeekFormat" is not in camel caps format
                      Open

                          public static function UseWeekFormat($aFlg)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Method name "DateScaleUtils::GetTicks" is not in camel caps format
                      Open

                          public static function GetTicks($aData, $aType = 1, $aMinor = false, $aEndPoints = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Method name "DateScaleUtils::GetTicksFromMinMax" is not in camel caps format
                      Open

                          public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Line exceeds 120 characters; contains 138 characters
                      Open

                                  [$spm, [1, DSUTILS_DAY1, 'd M', 2, DSUTILS_DAY2, 'd M', 4, DSUTILS_DAY4, 'd M', 7, DSUTILS_WEEK1, $w, -1, DSUTILS_WEEK2, $w]],
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Line exceeds 120 characters; contains 137 characters
                      Open

                              // Second value: Array of formatting depending on divisor for wanted max number of ticks. <divisor><formatting><format-string>,..
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Line exceeds 120 characters; contains 121 characters
                      Open

                                              list($tickPositions, $minTickPositions) = self::GetTicksFromMinMax($aMin, $aMax, $type, $aMinor);
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Line exceeds 120 characters; contains 205 characters
                      Open

                                  [-1, [30, DSUTILS_MONTH1, 'M-Y', 60, DSUTILS_MONTH2, 'M-Y', 90, DSUTILS_MONTH3, 'M-Y', 180, DSUTILS_MONTH6, 'M-Y', 352, DSUTILS_YEAR1, 'Y', 704, DSUTILS_YEAR2, 'Y', -1, DSUTILS_YEAR5, 'Y']], ];
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      Line exceeds 120 characters; contains 213 characters
                      Open

                                  [$spy, [1, DSUTILS_DAY1, 'd M', 2, DSUTILS_DAY2, 'd M', 4, DSUTILS_DAY4, 'd M', 7, DSUTILS_WEEK1, $w, 14, DSUTILS_WEEK2, $w, 30, DSUTILS_MONTH1, 'M', 60, DSUTILS_MONTH2, 'M', -1, DSUTILS_MONTH3, 'M']],
                      Severity: Minor
                      Found in src/util/DateScaleUtils.php by phpcodesniffer

                      There are no issues that match your filters.

                      Category
                      Status