HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

File config.inc.php has 406 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * JPGraph - Community Edition
 */
Severity: Minor
Found in src/config.inc.php - About 5 hrs to fix

    Method _StrokeRegularRose has 140 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _StrokeRegularRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
        {
            // _StrokeRegularRose($dblImg,$xc,$yc,$r,$ri)
            // Plot radial grid lines and remember the end position
            // and the angle for later use when plotting the labels
    Severity: Major
    Found in src/plot/WindrosePlot.php - About 5 hrs to fix

      Function StrokeLabel has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          public function StrokeLabel($label, $img, $xc, $yc, $a, $r)
          {
              // Default value
              if ($this->ilabelposadj === 'auto') {
                  $this->ilabelposadj = 0.65;
      Severity: Minor
      Found in src/plot/PiePlot.php - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          public function Stroke($aOtherAxisScale, $aStrokeLabels = true)
          {
              if ($this->hide) {
                  return;
              }
      Severity: Minor
      Found in src/graph/Axis.php - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method _StrokeTTF has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $debug = false)
          {
              // Setup default inter line margin for paragraphs to be
              // 3% of the font height.
              $ConstLineSpacing = 0.03;
      Severity: Major
      Found in src/image/Image.php - About 5 hrs to fix

        File HandDigits.php has 396 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * JPGraph v4.0.3
         */
        Severity: Minor
        Found in src/image/HandDigits.php - About 5 hrs to fix

          File LinePlot.php has 395 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * JPGraph v4.0.3
           */
          Severity: Minor
          Found in src/plot/LinePlot.php - About 5 hrs to fix

            Method StrokeTitles has 137 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function StrokeTitles()
                {
                    $margin = 3;
            
                    if ($this->titlebackground) {
            Severity: Major
            Found in src/graph/Graph.php - About 5 hrs to fix

              Function StrokeDays has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function StrokeDays($aYCoord, $getHeight = false)
                  {
                      $img      = $this->iImg;
                      $daywidth = $this->GetDayWidth();
                      $xt       = $img->left_margin + $this->iLabelWidth;
              Severity: Minor
              Found in src/graph/GanttScale.php - About 5 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              File Legend.php has 389 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * JPGraph v4.0.3
               */
              Severity: Minor
              Found in src/graph/Legend.php - About 5 hrs to fix

                WindrosePlot has 40 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class WindrosePlot
                {
                    private $iAntiAlias          = true;
                    private $iData               = [];
                    public $iX                   = 0.5;
                Severity: Minor
                Found in src/plot/WindrosePlot.php - About 5 hrs to fix

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

                      public static function tryHexConversion($aColor)
                      {
                          if (is_array($aColor)) {
                              if (safe_count($aColor) == 3) {
                                  if (is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2])) {
                  Severity: Major
                  Found in src/image/RGB.php and 1 other location - About 5 hrs to fix
                  src/util/RGB.php on lines 584..599

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

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

                      public static function tryHexConversion($aColor)
                      {
                          if (is_array($aColor)) {
                              if (safe_count($aColor) == 3) {
                                  if (is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2])) {
                  Severity: Major
                  Found in src/util/RGB.php and 1 other location - About 5 hrs to fix
                  src/image/RGB.php on lines 594..609

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

                  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

                  Method StrokeFrameBackground has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function StrokeFrameBackground()
                      {
                          if ($this->background_image != '' && $this->background_cflag != '') {
                              Util\JpGraphError::RaiseL(25040); //('It is not possible to specify both a background image and a background country flag.');
                          }
                  Severity: Major
                  Found in src/graph/Graph.php - About 5 hrs to fix

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

                        public function Stroke($img, $xscale, $yscale)
                        {
                            $n = $this->numpoints;
                            if ($this->center) {
                                --$n;
                    Severity: Minor
                    Found in src/plot/StockPlot.php - About 5 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        public function IntAutoScale($img, $min, $max, $maxsteps, $majend = true)
                        {
                            // Make sure limits are integers
                            $min = floor($min);
                            $max = ceil($max);
                    Severity: Minor
                    Found in src/graph/LinearScale.php - About 5 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

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

                    Cognitive Complexity

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

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

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

                    Further reading

                    Method _StrokeFreeRose has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _StrokeFreeRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
                        {
                            // Plot radial grid lines and remember the end position
                            // and the angle for later use when plotting the labels
                            if ($this->iType != WINDROSE_TYPEFREE) {
                    Severity: Major
                    Found in src/plot/WindrosePlot.php - About 5 hrs to fix

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

                          public function Stroke($aImg, $aX = null, $aY = null)
                          {
                              if ($aX !== null && $aY !== null) {
                                  $this->iXPos = $aX;
                                  $this->iYPos = $aY;
                      Severity: Minor
                      Found in src/text/GTextTable.php - About 5 hrs to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          public function Stroke($aImg, $aScale)
                          {
                              $factory = new Graph\RectPatternFactory();
                              $prect   = $factory->Create($this->iPattern, $this->iPatternColor);
                              $prect->SetDensity($this->iPatternDensity);
                      Severity: Major
                      Found in src/plot/GanttBar.php - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language