HuasoFoundries/jpgraph

View on GitHub
src/graph/GanttGraph.php

Summary

Maintainability
F
1 wk
Test Coverage

Function AutoSize has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
Open

    public function AutoSize()
    {
        if ($this->img->img == null) {
            // The predefined left, right, top, bottom margins.
            // Note that the top margin might incease depending on
Severity: Minor
Found in src/graph/GanttGraph.php - About 1 day 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 GanttGraph.php has 649 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * JPGraph v4.0.3
 */
Severity: Major
Found in src/graph/GanttGraph.php - About 1 day to fix

    Function StrokeConstrains has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
    Open

        public function StrokeConstrains()
        {
            $n = safe_count($this->iObj);
    
            // Stroke all constrains
    Severity: Minor
    Found in src/graph/GanttGraph.php - About 1 day 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 AutoSize has 186 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function AutoSize()
        {
            if ($this->img->img == null) {
                // The predefined left, right, top, bottom margins.
                // Note that the top margin might incease depending on
    Severity: Major
    Found in src/graph/GanttGraph.php - About 7 hrs to fix

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

          public function CreateSimple($data, $constrains = [], $progress = [])
          {
              $num = safe_count($data);
              for ($i = 0; $i < $num; ++$i) {
                  switch ($data[$i][1]) {
      Severity: Minor
      Found in src/graph/GanttGraph.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

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

      class GanttGraph extends Graph
      {
          public $scale; // Public accessible
          public $hgrid;
          private $iObj                    = []; // Gantt objects
      Severity: Minor
      Found in src/graph/GanttGraph.php by phpmd

      Method CreateSimple has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function CreateSimple($data, $constrains = [], $progress = [])
          {
              $num = safe_count($data);
              for ($i = 0; $i < $num; ++$i) {
                  switch ($data[$i][1]) {
      Severity: Major
      Found in src/graph/GanttGraph.php - About 2 hrs to fix

        Method Stroke has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function Stroke($aStrokeFileName = '')
            {
                // If the filename is the predefined value = '_csim_special_'
                // we assume that the call to stroke only needs to do enough
                // to correctly generate the CSIM maps.
        Severity: Major
        Found in src/graph/GanttGraph.php - About 2 hrs to fix

          Method StrokeConstrains has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function StrokeConstrains()
              {
                  $n = safe_count($this->iObj);
          
                  // Stroke all constrains
          Severity: Major
          Found in src/graph/GanttGraph.php - About 2 hrs to fix

            GanttGraph has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class GanttGraph extends Graph
            {
                public $scale; // Public accessible
                public $hgrid;
                private $iObj                    = []; // Gantt objects
            Severity: Minor
            Found in src/graph/GanttGraph.php - About 2 hrs to fix

              Function Stroke has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function Stroke($aStrokeFileName = '')
                  {
                      // If the filename is the predefined value = '_csim_special_'
                      // we assume that the call to stroke only needs to do enough
                      // to correctly generate the CSIM maps.
              Severity: Minor
              Found in src/graph/GanttGraph.php - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  public function Add($aObject)
                  {
                      if (is_array($aObject) && safe_count($aObject) > 0) {
                          $cl = $aObject[0];
                          if (($cl instanceof Plot\IconPlot)) {
              Severity: Minor
              Found in src/graph/GanttGraph.php - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function GetMaxLabelWidth has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function GetMaxLabelWidth()
                  {
                      $m = 10;
                      if ($this->iObj != null) {
                          $marg = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin;
              Severity: Minor
              Found in src/graph/GanttGraph.php - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  public function GetMaxActInfoColWidth()
                  {
                      $n = safe_count($this->iObj);
                      if ($n == 0) {
                          return;
              Severity: Minor
              Found in src/graph/GanttGraph.php - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Avoid deeply nested control flow statements.
              Open

                                      switch ($this->iObj[$i]->constraints[$k]->iConstrainType) {
                                          case CONSTRAIN_ENDSTART:
                                              if ($c1[1] < $c2[1]) {
                                                  $link = new Image\GanttLink($c1[2], $c1[3], $c2[0], $c2[1]);
                                              } else {
              Severity: Major
              Found in src/graph/GanttGraph.php - About 45 mins to fix

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

                    public function StrokeTexts()
                    {
                        // Stroke any user added text objects
                        if ($this->texts != null) {
                            $n = safe_count($this->texts);
                Severity: Minor
                Found in src/graph/GanttGraph.php - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    public function GetBarMinMax()
                    {
                        $start = 0;
                        $n     = safe_count($this->iObj);
                        while ($start < $n && $this->iObj[$start]->GetMaxDate() === false) {
                Severity: Minor
                Found in src/graph/GanttGraph.php - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Avoid deeply nested control flow statements.
                Open

                                        if ($this->iObj[$j]->iVPos == $vpos) {
                                            $targetobj = $j;
                                        }
                Severity: Major
                Found in src/graph/GanttGraph.php - About 45 mins to fix

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

                      public function __construct($aWidth = 0, $aHeight = 0, $aCachedName = '', $aTimeOut = 0, $aInline = true)
                  Severity: Minor
                  Found in src/graph/GanttGraph.php - About 35 mins to fix

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

                        public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                    Severity: Minor
                    Found in src/graph/GanttGraph.php - About 35 mins to fix

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

                          public function GetMaxLabelHeight()
                          {
                              $m = 10;
                              if ($this->iObj != null) {
                                  $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          public function AutoSize()
                          {
                              if ($this->img->img == null) {
                                  // The predefined left, right, top, bottom margins.
                                  // Note that the top margin might incease depending on
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

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

                          public function Stroke($aStrokeFileName = '')
                          {
                              // If the filename is the predefined value = '_csim_special_'
                              // we assume that the call to stroke only needs to do enough
                              // to correctly generate the CSIM maps.
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      The method AutoSize() has an NPath complexity of 359326801. The configured NPath complexity threshold is 200.
                      Open

                          public function AutoSize()
                          {
                              if ($this->img->img == null) {
                                  // The predefined left, right, top, bottom margins.
                                  // Note that the top margin might incease depending on
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 CreateSimple() has an NPath complexity of 209. The configured NPath complexity threshold is 200.
                      Open

                          public function CreateSimple($data, $constrains = [], $progress = [])
                          {
                              $num = safe_count($data);
                              for ($i = 0; $i < $num; ++$i) {
                                  switch ($data[$i][1]) {
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 Stroke() has an NPath complexity of 864. The configured NPath complexity threshold is 200.
                      Open

                          public function Stroke($aStrokeFileName = '')
                          {
                              // If the filename is the predefined value = '_csim_special_'
                              // we assume that the call to stroke only needs to do enough
                              // to correctly generate the CSIM maps.
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 StrokeConstrains() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function StrokeConstrains()
                          {
                              $n = safe_count($this->iObj);
                      
                              // Stroke all constrains
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 CreateSimple() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function CreateSimple($data, $constrains = [], $progress = [])
                          {
                              $num = safe_count($data);
                              for ($i = 0; $i < $num; ++$i) {
                                  switch ($data[$i][1]) {
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 Stroke() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function Stroke($aStrokeFileName = '')
                          {
                              // If the filename is the predefined value = '_csim_special_'
                              // we assume that the call to stroke only needs to do enough
                              // to correctly generate the CSIM maps.
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 AutoSize() has a Cyclomatic Complexity of 53. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function AutoSize()
                          {
                              if ($this->img->img == null) {
                                  // The predefined left, right, top, bottom margins.
                                  // Note that the top margin might incease depending on
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 __construct has a boolean flag argument $aInline, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function __construct($aWidth = 0, $aHeight = 0, $aCachedName = '', $aTimeOut = 0, $aInline = true)
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 AutoSize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $fw = 2;
                                  }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 'StrokeConstrains'.
                      Open

                                              Util\JpGraphError::RaiseL(6008, $this->iObj[$i]->iVPos, $vpos);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 StrokeConstrains uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                                      } else {
                                                          $link = new Image\GanttLink($c1[2], $c1[1], $c2[0], $c2[3]);
                                                      }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 StrokeConstrains uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                                      } else {
                                                          $link = new Image\GanttLink($c1[0], $c1[1], $c2[0], $c2[3]);
                                                      }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 '__construct'.
                      Open

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

                                          } else {
                                              $m = max($m, $this->iObj[$i]->title->GetWidth($this->img));
                                          }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 GetMaxActInfoColWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $w[$j] = max($w[$j], $tmp[$j]);
                                      }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 'SetScale'.
                      Open

                              Util\JpGraphError::RaiseL(6005);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

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

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

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

                                                      } else {
                                                          $link = new Image\GanttLink($c1[2], $c1[1], $c2[2], $c2[3]);
                                                      }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 'StrokeConstrains'.
                      Open

                                                      Util\JpGraphError::RaiseL(6009, $this->iObj[$i]->iVPos, $vpos);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

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

                                  } else {
                                      $n = safe_count($aObject);
                                      for ($i = 0; $i < $n; ++$i) {
                                          $this->iObj[] = $aObject[$i];
                                      }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 'CreateSimple'.
                      Open

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

                                                      } else {
                                                          $link = new Image\GanttLink($c1[0], $c1[1], $c2[2], $c2[3]);
                                                      }
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 'CreateSimple'.
                      Open

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

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

                              } else {
                                  if (($aObject instanceof Plot\IconPlot)) {
                                      $this->AddIcon($aObject);
                                  } elseif (($aObject instanceof Text\Text)) {
                                      $this->AddText($aObject);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 Add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $this->iObj[] = $aObject;
                                  }
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ElseExpression

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid unused parameters such as '$aXMax'.
                      Open

                          public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      UnusedFormalParameter

                      Since: 0.2

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

                      Example

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

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

                      Avoid unused parameters such as '$aYMax'.
                      Open

                          public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      UnusedFormalParameter

                      Since: 0.2

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

                      Example

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

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

                      Avoid unused parameters such as '$aYMin'.
                      Open

                          public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      UnusedFormalParameter

                      Since: 0.2

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

                      Example

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

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

                      Avoid unused parameters such as '$aXMin'.
                      Open

                          public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      UnusedFormalParameter

                      Since: 0.2

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

                      Example

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

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

                      Avoid unused private fields such as '$iLabelHMarginFactor'.
                      Open

                          private $iLabelHMarginFactor     = 0.2; // 10% margin on each side of the labels
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      UnusedPrivateField

                      Since: 0.2

                      Detects when a private field is declared and/or assigned a value, but not used.

                      Example

                      class Something
                      {
                          private static $FOO = 2; // Unused
                          private $i = 5; // Unused
                          private $j = 6;
                          public function addOne()
                          {
                              return $this->j++;
                          }
                      }

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

                      The method CreateSimple() contains an exit expression.
                      Open

                                          die('Unknown activity type');
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ExitExpression

                      Since: 0.2

                      An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                      Example

                      class Foo {
                          public function bar($param)  {
                              if ($param === 42) {
                                  exit(23);
                              }
                          }
                      }

                      Source https://phpmd.org/rules/design.html#exitexpression

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

                                  $marg = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      UnusedLocalVariable

                      Since: 0.2

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

                      Example

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

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

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

                                              list($tot, $w) = $this->iObj[$i]->title->GetWidth($this->img, true);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 '$aAxisType'.
                      Open

                          public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                      Severity: Minor
                      Found in src/graph/GanttGraph.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

                                                  case CONSTRAIN_STARTEND:
                                                      if ($c1[1] < $c2[1]) {
                                                          $link = new Image\GanttLink($c1[0], $c1[3], $c2[2], $c2[1]);
                                                      } else {
                                                          $link = new Image\GanttLink($c1[0], $c1[1], $c2[2], $c2[3]);
                      Severity: Major
                      Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
                      src/graph/GanttGraph.php on lines 856..864
                      src/graph/GanttGraph.php on lines 874..882
                      src/graph/GanttGraph.php on lines 883..891

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

                      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

                                                  case CONSTRAIN_STARTSTART:
                                                      if ($c1[1] < $c2[1]) {
                                                          $link = new Image\GanttLink($c1[0], $c1[3], $c2[0], $c2[1]);
                                                      } else {
                                                          $link = new Image\GanttLink($c1[0], $c1[1], $c2[0], $c2[3]);
                      Severity: Major
                      Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
                      src/graph/GanttGraph.php on lines 856..864
                      src/graph/GanttGraph.php on lines 865..873
                      src/graph/GanttGraph.php on lines 874..882

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

                      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

                                                  case CONSTRAIN_ENDEND:
                                                      if ($c1[1] < $c2[1]) {
                                                          $link = new Image\GanttLink($c1[2], $c1[3], $c2[2], $c2[1]);
                                                      } else {
                                                          $link = new Image\GanttLink($c1[2], $c1[1], $c2[2], $c2[3]);
                      Severity: Major
                      Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
                      src/graph/GanttGraph.php on lines 856..864
                      src/graph/GanttGraph.php on lines 865..873
                      src/graph/GanttGraph.php on lines 883..891

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

                      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

                                                  case CONSTRAIN_ENDSTART:
                                                      if ($c1[1] < $c2[1]) {
                                                          $link = new Image\GanttLink($c1[2], $c1[3], $c2[0], $c2[1]);
                                                      } else {
                                                          $link = new Image\GanttLink($c1[2], $c1[1], $c2[0], $c2[3]);
                      Severity: Major
                      Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
                      src/graph/GanttGraph.php on lines 865..873
                      src/graph/GanttGraph.php on lines 874..882
                      src/graph/GanttGraph.php on lines 883..891

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

                      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 excessively long variable names like $iSimpleProgressBkgColor. Keep variable name length under 20.
                      Open

                          private $iSimpleProgressBkgColor = 'gray';
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      LongVariable

                      Since: 0.2

                      Detects when a field, formal or local variable is declared with a long name.

                      Example

                      class Something {
                          protected $reallyLongIntName = -3; // VIOLATION - Field
                          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                              $otherReallyLongName = -5; // VIOLATION - Local
                              for ($interestingIntIndex = 0; // VIOLATION - For
                                   $interestingIntIndex < 10;
                                   $interestingIntIndex++ ) {
                              }
                          }
                      }

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

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

                                  $lm = $this->img->left_margin;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = 10;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $bm. Configured minimum length is 3.
                      Open

                                  $bm = $this->img->bottom_margin + $vadj;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $ww. Configured minimum length is 3.
                      Open

                                      $ww = $fsw * $this->scale->week->GetFontWidth($this->img);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = $this->scale->GetHeaderHeight();
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = [];
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $c2. Configured minimum length is 3.
                      Open

                                          $c2 = $this->iObj[$targetobj]->iConstrainPos;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $a. Configured minimum length is 3.
                      Open

                                          $a = new Plot\GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 8);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                          $y = $this->scale->TranslateVertPos($this->texts[$i]->iScalePosY);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $rm. Configured minimum length is 3.
                      Open

                                  $rm = $this->img->right_margin + $hadj;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                      $n = safe_count($aObject);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                          $n = safe_count($constrains);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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

                                              list($tot, $w) = $this->iObj[$i]->title->GetWidth($this->img, true);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $c1. Configured minimum length is 3.
                      Open

                                          $c1 = $this->iObj[$i]->iConstrainPos;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $n    = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = 0;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $n     = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $tm. Configured minimum length is 3.
                      Open

                                  $tm = $this->img->top_margin;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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      = max($this->GetMaxLabelHeight(), $this->GetMaxBarAbsHeight());
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $nd = $this->scale->GetNumberOfDays();
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $nn. Configured minimum length is 3.
                      Open

                                  $nn  = safe_count($tmp);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                          $x = $this->scale->TranslateDate($this->texts[$i]->iScalePosX);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = 10;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $cw. Configured minimum length is 3.
                      Open

                                  $cw = $this->GetMaxActInfoColWidth();
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $n = safe_count($this->iObj);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $cl. Configured minimum length is 3.
                      Open

                                  $cl = $aObject[0];
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 = 1;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $n2. Configured minimum length is 3.
                      Open

                                          $n2  = ceil(60 / $this->scale->minute->GetIntervall());
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $fw. Configured minimum length is 3.
                      Open

                                      $fw = $this->scale->day->GetFontWidth($this->img) + 4;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $hw. Configured minimum length is 3.
                      Open

                                      $hw  = $n * $hfw;
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                                  $n = safe_count($this->texts);
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 $mw. Configured minimum length is 3.
                      Open

                                      $mw  = $hfw;
                      Severity: Minor
                      Found in src/graph/GanttGraph.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 "GanttGraph::GetCSIMAreas" is not in camel caps format
                      Open

                          public function GetCSIMAreas()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetLabelVMarginFactor" is not in camel caps format
                      Open

                          public function SetLabelVMarginFactor($aVal)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetDateRange" is not in camel caps format
                      Open

                          public function SetDateRange($aStart, $aEnd)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

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

                          public function Stroke($aStrokeFileName = '')
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::Add" is not in camel caps format
                      Open

                          public function Add($aObject)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::GetMaxLabelHeight" is not in camel caps format
                      Open

                          public function GetMaxLabelHeight()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetSimpleStyle" is not in camel caps format
                      Open

                          public function SetSimpleStyle($aBand, $aColor, $aBkgColor)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::GetBarMaxLineNumber" is not in camel caps format
                      Open

                          public function GetBarMaxLineNumber()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetZoomFactor" is not in camel caps format
                      Open

                          public function SetZoomFactor($aZoom)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::GetMaxLabelWidth" is not in camel caps format
                      Open

                          public function GetMaxLabelWidth()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::ShowHeaders" is not in camel caps format
                      Open

                          public function ShowHeaders($aFlg)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetScale" is not in camel caps format
                      Open

                          public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::StrokeConstrains" is not in camel caps format
                      Open

                          public function StrokeConstrains()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::CreateSimple" is not in camel caps format
                      Open

                          public function CreateSimple($data, $constrains = [], $progress = [])
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::GetMaxActInfoColWidth" is not in camel caps format
                      Open

                          public function GetMaxActInfoColWidth()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetSimpleFont" is not in camel caps format
                      Open

                          public function SetSimpleFont($aFont, $aSize)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::SetVMarginFactor" is not in camel caps format
                      Open

                          public function SetVMarginFactor($aVal)
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::GetMaxBarAbsHeight" is not in camel caps format
                      Open

                          public function GetMaxBarAbsHeight()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::StrokeTexts" is not in camel caps format
                      Open

                          public function StrokeTexts()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::GetBarMinMax" is not in camel caps format
                      Open

                          public function GetBarMinMax()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Method name "GanttGraph::AutoSize" is not in camel caps format
                      Open

                          public function AutoSize()
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Line exceeds 120 characters; contains 174 characters
                      Open

                                                  //("Invalid format for Progress parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)");
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Line exceeds 120 characters; contains 194 characters
                      Open

                                                  //("Invalid format for Constrain parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)");
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Line exceeds 120 characters; contains 121 characters
                      Open

                                                      //('Unknown constrain type specified from row='.$this->iObj[$i]->iVPos.' to row='.$vpos);
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Line exceeds 120 characters; contains 231 characters
                      Open

                                      //("Sanity check for automatic Gantt chart size failed. Either the width (=$width) or height (=$height) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.");
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Line exceeds 120 characters; contains 163 characters
                      Open

                                  //("You can't specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension.");
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      Line exceeds 120 characters; contains 147 characters
                      Open

                                              //('You have specifed a constrain from row='.$this->iObj[$i]->iVPos.' to row='.$vpos.' which does not have any activity.');
                      Severity: Minor
                      Found in src/graph/GanttGraph.php by phpcodesniffer

                      There are no issues that match your filters.

                      Category
                      Status