HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

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

    public function Stroke($img, $grid)
    {
        if (!$this->show) {
            return;
        }
Severity: Minor
Found in src/graph/RadarGrid.php - About 1 hr to fix

    Method GetMonthLabel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function GetMonthLabel($aMonthNbr, $year)
        {
            $sn = $this->iDateLocale->GetShortMonthName($aMonthNbr);
            $ln = $this->iDateLocale->GetLongMonthName($aMonthNbr);
            switch ($this->month->iStyle) {
    Severity: Minor
    Found in src/graph/GanttScale.php - About 1 hr to fix

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

                      for ($a = $rsa; $a < 2 * M_PI; $a += $step) {
                          $tca  = cos($a);
                          $tsa  = sin($a);
                          $p[]  = $xc + $w * $tca;
                          $p[]  = $z + $yc - $h * $tsa;
      Severity: Major
      Found in src/plot/PiePlot3D.php and 3 other locations - About 1 hr to fix
      src/plot/PiePlot3D.php on lines 287..294
      src/plot/PiePlot3D.php on lines 312..319
      src/plot/PiePlot3D.php on lines 337..344

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

      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

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

                      for ($a = $rea; $a > M_PI; $a -= $step) {
                          $tca  = cos($a);
                          $tsa  = sin($a);
                          $p[]  = $xc + $w * $tca;
                          $p[]  = $z + $yc - $h * $tsa;
      Severity: Major
      Found in src/plot/PiePlot3D.php and 3 other locations - About 1 hr to fix
      src/plot/PiePlot3D.php on lines 253..260
      src/plot/PiePlot3D.php on lines 287..294
      src/plot/PiePlot3D.php on lines 312..319

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

      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

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

                      for ($a = $rsa; $a < $rea; $a += $step) {
                          $tca  = cos($a);
                          $tsa  = sin($a);
                          $p[]  = $xc + $w * $tca;
                          $p[]  = $z + $yc - $h * $tsa;
      Severity: Major
      Found in src/plot/PiePlot3D.php and 3 other locations - About 1 hr to fix
      src/plot/PiePlot3D.php on lines 253..260
      src/plot/PiePlot3D.php on lines 312..319
      src/plot/PiePlot3D.php on lines 337..344

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

      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

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

                  for ($a = $rea; $a > $rsa; $a -= $step) {
                      $tca  = cos($a);
                      $tsa  = sin($a);
                      $p[]  = $xc + $w * $tca;
                      $p[]  = $z + $yc - $h * $tsa;
      Severity: Major
      Found in src/plot/PiePlot3D.php and 3 other locations - About 1 hr to fix
      src/plot/PiePlot3D.php on lines 253..260
      src/plot/PiePlot3D.php on lines 287..294
      src/plot/PiePlot3D.php on lines 337..344

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

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

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

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

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

      Refactorings

      Further Reading

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

              for ($i = 0; $i < $n; ++$i) {
                  $nc          = safe_count($this->plots[$i]->coords[0]);
                  $nmax        = max($nmax, $nc);
                  list($x, $y) = $this->plots[$i]->Min();
                  $xmin        = min($xmin, $x);
      Severity: Major
      Found in src/plot/AccLinePlot.php and 1 other location - About 1 hr to fix
      src/plot/AccBarPlot.php on lines 121..127

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

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

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

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

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

      Refactorings

      Further Reading

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

              for ($i = 0; $i < safe_count($this->plots); ++$i) {
                  $n           = safe_count($this->plots[$i]->coords[0]);
                  $nmax        = max($nmax, $n);
                  list($x, $y) = $this->plots[$i]->Min();
                  $xmin        = min($xmin, $x);
      Severity: Major
      Found in src/plot/AccBarPlot.php and 1 other location - About 1 hr to fix
      src/plot/AccLinePlot.php on lines 89..95

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

      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

      Consider simplifying this complex logical expression.
      Open

                              if ($midval == $ib) {
                                  // Orientation "+"
                                  $n1 = 0;
                                  $n2 = 1;
                                  $n3 = 2;
      Severity: Major
      Found in src/plot/Contour.php - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                        if (($a < 90 && ($a + $da > 270)) || ($a > 90 && $a <= 270 && ($a + $da > 360 + 90)) || ($a > 270 && $this->NormAngle($a + $da) > 270)) {
                            $angles[++$idx]   = [$split, 360 - $split];
                            $adjcolors[$idx]  = $colors[$i % $numcolors];
                            $adjexplode[$idx] = $explode;
                            $angles[++$idx]   = [360 - $split, $ne];
        Severity: Major
        Found in src/plot/PiePlot3D.php - About 1 hr to fix

          Method Add3DSliceToCSIM has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function Add3DSliceToCSIM($i, $xc, $yc, $height, $width, $thick, $sa, $ea)
          Severity: Major
          Found in src/plot/PiePlot3D.php - About 1 hr to fix

            Method _StrokeWindLeg has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function _StrokeWindLeg($aImg, $xc, $yc, $a, $ri, $r, $weight, $color)
            Severity: Major
            Found in src/plot/WindrosePlot.php - About 1 hr to fix

              Method ShadowRectangle has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function ShadowRectangle($xl, $yu, $xr, $yl, $fcolor = false, $shadow_width = 4, $shadow_color = 'darkgray', $useAlpha = true)
              Severity: Major
              Found in src/image/Image.php - About 1 hr to fix

                Method _Skew3D has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function _Skew3D($aGdImg, $aHorizon = 120, $aSkewDist = 150, $aDir = SKEW3D_DOWN, $aHiQuality = false, $aMinSize = true, $aFillColor = '#FFFFFF', $aBorder = false)
                Severity: Major
                Found in src/image/ImgTrans.php - About 1 hr to fix

                  Method CakeSlice has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function CakeSlice($xc, $yc, $w, $h, $s, $e, $fillcolor = '', $arccolor = '')
                  Severity: Major
                  Found in src/image/Image.php - About 1 hr to fix

                    Method imageSmoothArc has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, $start, $stop)
                    Severity: Major
                    Found in src/image/Image.php - About 1 hr to fix

                      Method Set3DPerspective has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function Set3DPerspective($aDir = 1, $aHorizon = 100, $aSkewDist = 120, $aQuality = false, $aFillColor = '#FFFFFF', $aBorder = false, $aMinSize = true, $aHorizonPos = 0.5)
                      Severity: Major
                      Found in src/graph/Graph.php - About 1 hr to fix

                        Method _gdImgHandle has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function _gdImgHandle($agdCanvas, $x, $y, $fx = 0, $fy = 0, $w = 0, $h = 0, $mix = 100)
                        Severity: Major
                        Found in src/graph/MGraph.php - About 1 hr to fix

                          Method AddMix has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function AddMix($aGraph, $x = 0, $y = 0, $mix = 100, $fx = 0, $fy = 0, $w = 0, $h = 0)
                          Severity: Major
                          Found in src/graph/MGraph.php - About 1 hr to fix

                            Each class must be in a namespace of at least one level (a top-level vendor name)
                            Open

                            class Rectangle
                            Severity: Minor
                            Found in src/graph/Rectangle.php by phpcodesniffer
                            Severity
                            Category
                            Status
                            Source
                            Language