HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

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

LineTest has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

class LineTest extends \Codeception\Test\Unit
{
    use Amenadiel\JpGraph\UnitTest\UnitTestTrait;

    public static $fixTures = [];
Severity: Minor
Found in tests/LineTest.php - About 4 hrs to fix

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

        public function Stroke($aImg, $aX, $aY, $aWidth, $aHeight)
        {
            // If this is a merged cell we only stroke if it is the parent cell.
            // The parent cell holds the merged cell block
            if ($this->iMerged && ($this->iRow != $this->iPRow || $this->iCol != $this->iPCol)) {
    Severity: Major
    Found in src/text/GTextTableCell.php - About 3 hrs to fix

      Method Stroke has 97 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/RadarGraph.php - About 3 hrs to fix

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

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

          PiePlot has 31 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class PiePlot
          {
              public $posx                     = 0.5;
              public $posy                     = 0.5;
              public $is_using_plot_theme      = false;
          Severity: Minor
          Found in src/plot/PiePlot.php - About 3 hrs to fix

            AxisPrototype has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class AxisPrototype
            {
                public $scale;
                public $img;
                public $hide        = false;
            Severity: Minor
            Found in src/graph/AxisPrototype.php - About 3 hrs to fix

              Function _doAutoTickPos has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _doAutoTickPos($aScale)
                  {
                      $maj_step_abs = $aScale->scale_factor * $this->major_step;
                      $min_step_abs = $aScale->scale_factor * $this->minor_step;
              
              
              Severity: Minor
              Found in src/graph/LinearTicks.php - About 3 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              Method ImgData_Squares has 93 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function ImgData_Squares()
                  {
                      /*
                       *sq_lblue.png
                       */
              Severity: Major
              Found in src/image/ImgData_Squares.php - About 3 hrs to fix

                Method IntAutoScale has 92 lines of code (exceeds 25 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: Major
                Found in src/graph/LinearScale.php - About 3 hrs to fix

                  Method doAutoscaleXAxis has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function doAutoscaleXAxis()
                      {
                          $aPlots = array_filter($this->plots, function ($plot) {
                              //\Kint::dump($plot, $plot instanceof Plot\Plot);
                              return $plot instanceof Plot\Plot;
                  Severity: Major
                  Found in src/graph/Graph.php - About 3 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                                    if (($da <= 90 && ($a <= 90 && $ne > 90)) ||
                                        (($da <= 180 && $da > 90) && (($a < 90 || $a >= 270) && $ne > 90))) {
                                        $split = 90;
                                    } elseif (($da <= 90 && ($a <= 270 && $ne > 270)) ||
                                        (($da <= 180 && $da > 90) && ($a >= 90 && $a < 270 && ($a + $da) > 270))) {
                    Severity: Critical
                    Found in src/plot/PiePlot3D.php - About 3 hrs to fix

                      Text has 30 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Text //extends Graph
                      {
                          public $t;
                          public $x      = 0;
                          public $y      = 0;
                      Severity: Minor
                      Found in src/text/Text.php - About 3 hrs to fix

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

                            public function Stroke($img, $aaoption = 0)
                            {
                                $n = safe_count($this->data);
                        
                                // If user hasn't set the colors use the theme array
                        Severity: Minor
                        Found in src/plot/PiePlot3D.php - About 3 hrs to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function _TransVert3D has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function _TransVert3D($aGdImg, $aHorizon = 100, $aSkewDist = 120, $aDir = SKEW3D_DOWN, $aMinSize = true, $aFillColor = '#FFFFFF', $aQuality = false, $aBorder = false, $aHorizonPos = 0.5)
                            {
                                // Parameter check
                                if ($aHorizonPos < 0 || $aHorizonPos > 1.0) {
                                    Util\JpGraphError::RaiseL(9001);
                        Severity: Minor
                        Found in src/image/ImgTrans.php - About 3 hrs to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function Convert has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function Convert($aTxt, $aFF)
                            {
                                if (LANGUAGE_GREEK) {
                                    if (GREEK_FROM_WINDOWS) {
                                        $unistring = LanguageConv::gr_win2uni($aTxt);
                        Severity: Minor
                        Found in src/text/LanguageConv.php - About 3 hrs to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function StrokeGrid has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function StrokeGrid($pos)
                            {
                                $x = round($this->img->left_margin + $this->img->plotwidth / 2);
                                $this->scale->ticks->Stroke($this->img, $this->scale, $pos);
                        
                        
                        Severity: Minor
                        Found in src/graph/PolarAxis.php - About 3 hrs to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Method __construct has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __construct()
                            {
                                /*
                                 * File: bstar_green_001.png
                                 */
                        Severity: Major
                        Found in src/image/ImgData_Stars.php - About 3 hrs to fix

                          File DateScaleUtils.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

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

                            Method _StrokeLegend has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _StrokeLegend($aImg, $x, $y, $scaling = 1, $aReturnWidth = false)
                                {
                                    if (!$this->legend->iShow) {
                                        return 0;
                                    }
                            Severity: Major
                            Found in src/plot/WindrosePlot.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language