HuasoFoundries/jpgraph

View on GitHub
src/graph/DateScale.php

Summary

Maintainability
F
5 days
Test Coverage

Function DoDateAutoScale has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
    {
        // Format of array
        // array ( Decision point,  array( array( Major-scale-step-array ),
        //       array( Minor-scale-step-array ),
Severity: Minor
Found in src/graph/DateScale.php - About 5 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 AdjTime has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
    {
        $y = (int) date('Y', $aTime);
        $m = (int) date('m', $aTime);
        $d = (int) date('d', $aTime);
Severity: Minor
Found in src/graph/DateScale.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 DateScale.php has 348 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * JPGraph v4.0.3
 */
Severity: Minor
Found in src/graph/DateScale.php - About 4 hrs to fix

    Function AutoScale has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
        {
            // We need to have one dummy argument to make the signature of AutoScale()
            // identical to LinearScale::AutoScale
            if ($aStartTime == $aEndTime) {
    Severity: Minor
    Found in src/graph/DateScale.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

    Method DoDateAutoScale has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
        {
            // Format of array
            // array ( Decision point,  array( array( Major-scale-step-array ),
            //       array( Minor-scale-step-array ),
    Severity: Major
    Found in src/graph/DateScale.php - About 3 hrs to fix

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

      class DateScale extends LinearScale
      {
          private $date_format     = '';
          private $iStartAlign     = false;
          private $iEndAlign       = false;
      Severity: Minor
      Found in src/graph/DateScale.php by phpmd

      Function AdjDate has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
          {
              $y = (int) date('Y', $aTime);
              $m = (int) date('m', $aTime);
              $d = (int) date('d', $aTime);
      Severity: Minor
      Found in src/graph/DateScale.php - About 3 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 AdjTime has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
          {
              $y = (int) date('Y', $aTime);
              $m = (int) date('m', $aTime);
              $d = (int) date('d', $aTime);
      Severity: Major
      Found in src/graph/DateScale.php - About 2 hrs to fix

        Method AutoScale has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
            {
                // We need to have one dummy argument to make the signature of AutoScale()
                // identical to LinearScale::AutoScale
                if ($aStartTime == $aEndTime) {
        Severity: Major
        Found in src/graph/DateScale.php - About 2 hrs to fix

          Method AdjDate has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
              {
                  $y = (int) date('Y', $aTime);
                  $m = (int) date('m', $aTime);
                  $d = (int) date('d', $aTime);
          Severity: Major
          Found in src/graph/DateScale.php - About 2 hrs to fix

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

                public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
            Severity: Minor
            Found in src/graph/DateScale.php - About 35 mins to fix

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

                  public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
              Severity: Minor
              Found in src/graph/DateScale.php - About 35 mins to fix

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

                    public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
                Severity: Minor
                Found in src/graph/DateScale.php - About 35 mins to fix

                  The method AutoScale() has an NPath complexity of 24576. The configured NPath complexity threshold is 200.
                  Open

                      public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
                      {
                          // We need to have one dummy argument to make the signature of AutoScale()
                          // identical to LinearScale::AutoScale
                          if ($aStartTime == $aEndTime) {
                  Severity: Minor
                  Found in src/graph/DateScale.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 DoDateAutoScale() has 144 lines of code. Current threshold is set to 100. Avoid really long methods.
                  Open

                      public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
                      {
                          // Format of array
                          // array ( Decision point,  array( array( Major-scale-step-array ),
                          //       array( Minor-scale-step-array ),
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpmd

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

                      public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
                      {
                          $y = (int) date('Y', $aTime);
                          $m = (int) date('m', $aTime);
                          $d = (int) date('d', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
                      {
                          $y = (int) date('Y', $aTime);
                          $m = (int) date('m', $aTime);
                          $d = (int) date('d', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 DoDateAutoScale() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
                      {
                          // Format of array
                          // array ( Decision point,  array( array( Major-scale-step-array ),
                          //       array( Minor-scale-step-array ),
                  Severity: Minor
                  Found in src/graph/DateScale.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 AutoScale() has a Cyclomatic Complexity of 21. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
                      {
                          // We need to have one dummy argument to make the signature of AutoScale()
                          // identical to LinearScale::AutoScale
                          if ($aStartTime == $aEndTime) {
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjStartDate has a boolean flag argument $aDayType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjStartDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjEndDate has a boolean flag argument $aYearType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjEndDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime has a boolean flag argument $aHourType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjStartDate has a boolean flag argument $aMonthType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjStartDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime has a boolean flag argument $aSecType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime has a boolean flag argument $aMinType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate has a boolean flag argument $aDayType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate has a boolean flag argument $aMonthType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate has a boolean flag argument $aYearType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjEndDate has a boolean flag argument $aMonthType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjEndDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjEndDate has a boolean flag argument $aDayType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjEndDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjStartDate has a boolean flag argument $aYearType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjStartDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 SetTimeAlign has a boolean flag argument $aEndAlign, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function SetTimeAlign($aStartAlign, $aEndAlign = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjEndTime has a boolean flag argument $aMinType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjEndTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjEndTime has a boolean flag argument $aHourType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjEndTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjStartTime has a boolean flag argument $aSecType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjStartTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjustForDST has a boolean flag argument $aFlg, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjustForDST($aFlg = true)
                  Severity: Minor
                  Found in src/graph/DateScale.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 DoDateAutoScale has a boolean flag argument $aAdjust, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
                  Severity: Minor
                  Found in src/graph/DateScale.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 SetDateAlign has a boolean flag argument $aEndAlign, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function SetDateAlign($aStartAlign, $aEndAlign = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AutoScale has a boolean flag argument $_adummy, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjEndTime has a boolean flag argument $aSecType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjEndTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjStartTime has a boolean flag argument $aHourType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjStartTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjStartTime has a boolean flag argument $aMinType, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function AdjStartTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  ++$y;
                                  $y = ceil($y / $yearAdj[$aYearType]) * $yearAdj[$aYearType];
                              }
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      $d += (7 - $w);
                                      $h = 23;
                                      $i = 59;
                                      $s = 59;
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  ++$m;
                                  $m = ceil($m / $monthAdj[$aMonthType]) * $monthAdj[$aMonthType];
                                  $d = 1;
                              }
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  if (($h % $hourAdj[$aHourType] == 0) && ($i > 0 || $s > 0)) {
                                      ++$h;
                                  }
                                  $h = ceil($h / $hourAdj[$aHourType]) * $hourAdj[$aHourType];
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

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

                              } else {
                                  // Adjust to an even week boundary.
                                  $w = (int) date('w', $aTime); // Day of week 0=Sun, 6=Sat
                  
                                  // Adjust to start on Mon
                  Severity: Minor
                  Found in src/graph/DateScale.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 AutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $adjend = $this->AdjEndDate($aEndTime, false, false, $this->iEndAlign);
                              }
                  Severity: Minor
                  Found in src/graph/DateScale.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 AutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->ticks->SetLabelDateFormat($this->date_format);
                          }
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  if (($i % $minAdj[$aMinType] == 0) && $s > 0) {
                                      ++$i;
                                  }
                                  $i = ceil($i / $minAdj[$aMinType]) * $minAdj[$aMinType];
                  Severity: Minor
                  Found in src/graph/DateScale.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 AdjTime uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $s = ceil($s / $secAdj[$aSecType] * 1.0) * $secAdj[$aSecType];
                                  if ($s >= 60) {
                                      $s = 0;
                                      $aTime += 60;
                  Severity: Minor
                  Found in src/graph/DateScale.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 AutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $adjend = $this->AdjEndTime($aEndTime, false, false, $this->iEndTimeAlign);
                              }
                  Severity: Minor
                  Found in src/graph/DateScale.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 DoDateAutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                      } else {
                                          // Use time adjustment
                                          $adj = $scaleSteps[2][$idx + 1];
                                          if ($adj >= 30) {
                                              $start = $this->AdjStartTime($aStartTime, $adj - 30);
                  Severity: Minor
                  Found in src/graph/DateScale.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 DoDateAutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                          } else {
                                              $start = $this->AdjStartDate($aStartTime, false, false, $adj);
                                              $end   = $this->AdjEndDate($aEndTime, false, false, $adj);
                                              // We add 1 second for date adjustment to make sure we end on 00:00 the following day
                                              // This makes the final major tick be srawn when we step day-by-day instead of ending
                  Severity: Minor
                  Found in src/graph/DateScale.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 'AutoScale'.
                  Open

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

                              } else {
                                  $adjstart = $this->AdjStartDate($aStartTime, false, false, $this->iStartAlign);
                              }
                  Severity: Minor
                  Found in src/graph/DateScale.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 DoDateAutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                          } else {
                                              $start = $this->AdjStartTime($aStartTime, false, false, $adj);
                                              $end   = $this->AdjEndTime($aEndTime, false, false, $adj);
                                          }
                  Severity: Minor
                  Found in src/graph/DateScale.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 AutoScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $adjstart = $this->AdjStartTime($aStartTime, false, false, $this->iStartTimeAlign);
                              }
                  Severity: Minor
                  Found in src/graph/DateScale.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 '$ns'.
                  Open

                          $ns = safe_count($scalePoints);
                  Severity: Minor
                  Found in src/graph/DateScale.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 parameters such as '$_adummy'.
                  Open

                      public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
                  Severity: Minor
                  Found in src/graph/DateScale.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

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

                          if ($this->iStartAlign !== false) {
                              if ($this->iStartAlign >= 30) {
                                  $adjstart = $this->AdjStartDate($aStartTime, $this->iStartAlign - 30);
                              } elseif ($this->iStartAlign >= 20) {
                                  $adjstart = $this->AdjStartDate($aStartTime, false, $this->iStartAlign - 20);
                  Severity: Major
                  Found in src/graph/DateScale.php and 3 other locations - About 1 hr to fix
                  src/graph/DateScale.php on lines 480..488
                  src/graph/DateScale.php on lines 489..497
                  src/graph/DateScale.php on lines 508..516

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

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

                          if ($this->iEndAlign !== false) {
                              if ($this->iEndAlign >= 30) {
                                  $adjend = $this->AdjEndDate($aEndTime, $this->iEndAlign - 30);
                              } elseif ($this->iEndAlign >= 20) {
                                  $adjend = $this->AdjEndDate($aEndTime, false, $this->iEndAlign - 20);
                  Severity: Major
                  Found in src/graph/DateScale.php and 3 other locations - About 1 hr to fix
                  src/graph/DateScale.php on lines 480..488
                  src/graph/DateScale.php on lines 489..497
                  src/graph/DateScale.php on lines 499..507

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

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

                          if ($this->iStartTimeAlign !== false) {
                              if ($this->iStartTimeAlign >= 30) {
                                  $adjstart = $this->AdjStartTime($aStartTime, $this->iStartTimeAlign - 30);
                              } elseif ($this->iStartTimeAlign >= 20) {
                                  $adjstart = $this->AdjStartTime($aStartTime, false, $this->iStartTimeAlign - 20);
                  Severity: Major
                  Found in src/graph/DateScale.php and 3 other locations - About 1 hr to fix
                  src/graph/DateScale.php on lines 489..497
                  src/graph/DateScale.php on lines 499..507
                  src/graph/DateScale.php on lines 508..516

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

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

                          if ($this->iEndTimeAlign !== false) {
                              if ($this->iEndTimeAlign >= 30) {
                                  $adjend = $this->AdjEndTime($aEndTime, $this->iEndTimeAlign - 30);
                              } elseif ($this->iEndTimeAlign >= 20) {
                                  $adjend = $this->AdjEndTime($aEndTime, false, $this->iEndTimeAlign - 20);
                  Severity: Major
                  Found in src/graph/DateScale.php and 3 other locations - About 1 hr to fix
                  src/graph/DateScale.php on lines 480..488
                  src/graph/DateScale.php on lines 499..507
                  src/graph/DateScale.php on lines 508..516

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

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

                          $d = (int) date('d', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('Y', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 $s. Configured minimum length is 3.
                  Open

                          $s = (int) date('s', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('d', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('i', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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/graph/DateScale.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 = (int) date('H', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('m', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('w', $aTime); // Day of week 0=Sun, 6=Sat
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('m', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 $s. Configured minimum length is 3.
                  Open

                          $s = 0;
                  Severity: Minor
                  Found in src/graph/DateScale.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 = (int) date('Y', $aTime);
                  Severity: Minor
                  Found in src/graph/DateScale.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 = 0;
                  Severity: Minor
                  Found in src/graph/DateScale.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 $ns. Configured minimum length is 3.
                  Open

                          $ns = safe_count($scalePoints);
                  Severity: Minor
                  Found in src/graph/DateScale.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/graph/DateScale.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/graph/DateScale.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                                            = floor(($adjend - $adjstart) / $maj);
                  Severity: Minor
                  Found in src/graph/DateScale.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 "DateScale::SetDateAlign" is not in camel caps format
                  Open

                      public function SetDateAlign($aStartAlign, $aEndAlign = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AutoScale" is not in camel caps format
                  Open

                      public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjStartDate" is not in camel caps format
                  Open

                      public function AdjStartDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::DoDateAutoScale" is not in camel caps format
                  Open

                      public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::SetDateFormat" is not in camel caps format
                  Open

                      public function SetDateFormat($aFormat)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjustForDST" is not in camel caps format
                  Open

                      public function AdjustForDST($aFlg = true)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjDate" is not in camel caps format
                  Open

                      public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjTime" is not in camel caps format
                  Open

                      public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjEndTime" is not in camel caps format
                  Open

                      public function AdjEndTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjStartTime" is not in camel caps format
                  Open

                      public function AdjStartTime($aTime, $aHourType = false, $aMinType = false, $aSecType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::AdjEndDate" is not in camel caps format
                  Open

                      public function AdjEndDate($aTime, $aYearType = false, $aMonthType = false, $aDayType = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Method name "DateScale::SetTimeAlign" is not in camel caps format
                  Open

                      public function SetTimeAlign($aStartAlign, $aEndAlign = false)
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  Line indented incorrectly; expected at least 12 spaces, found 8
                  Open

                          ];
                  Severity: Minor
                  Found in src/graph/DateScale.php by phpcodesniffer

                  There are no issues that match your filters.

                  Category
                  Status