HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Function Set has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function Set($aArg1, $aArg2 = null, $aArg3 = null)
    {
        if ($aArg2 === null && $aArg3 === null) {
            if (is_array($aArg1)) {
                if (is_array($aArg1[0])) {
Severity: Minor
Found in src/text/GTextTable.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

Function AdjTime has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

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

Cognitive Complexity

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

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

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

Further reading

File Gradient.php has 349 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

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

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

    <?php
    
    /**
     * JPGraph v4.0.3
     */
    Severity: Minor
    Found in src/lang/en.inc.php - About 4 hrs to fix

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

      <?php
      
      /**
       * JPGraph v4.0.3
       */
      Severity: Minor
      Found in src/lang/de.inc.php - About 4 hrs to fix

        File DateScale.php has 348 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          Method SetAutoScaleAngle has 108 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function SetAutoScaleAngle($aIsRegRose = true)
              {
                  // If the user already has manually set an angle don't
                  // trye to find a position
                  if (is_numeric($this->scale->iAngle)) {
          Severity: Major
          Found in src/plot/WindrosePlot.php - About 4 hrs to fix

            Method StrokeBoxedText2 has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function StrokeBoxedText2(
                    $x,
                    $y,
                    $txt,
                    $dir = 0,
            Severity: Major
            Found in src/image/Image.php - About 4 hrs to fix

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

                  public function Stroke($aImg)
                  {
                      // The way the path for the arrow is constructed is partly based
                      // on some heuristics. This is not an exact science but draws the
                      // path in a way that, for me, makes esthetic sence. For example
              Severity: Major
              Found in src/image/GanttLink.php - About 4 hrs to fix

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

                    public function Stroke($aStrokeFileName = '')
                    {
                        // Start by adjusting the margin so that potential titles will fit.
                        $this->AdjustMarginsForTitles();
                
                
                Severity: Major
                Found in src/graph/PolarGraph.php - About 4 hrs to fix

                  Method StrokeDays has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method Init has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function Init()
                        {
                            // Setup limits for color indications
                            $lowx   = $this->iXMin;
                            $highx  = $this->iXMax;
                    Severity: Major
                    Found in src/graph/CCBPGraph.php - About 4 hrs to fix

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

                          public function Stroke($aGraph)
                          {
                              $aImg = $aGraph->img;
                      
                              if ($this->iX > 0 && $this->iX < 1) {
                      Severity: Minor
                      Found in src/plot/WindrosePlot.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

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

                          public function Stroke($aImg, $ax = -1, $ay = -1)
                          {
                              // To position the super script correctly we need different
                              // cases to handle the alignmewnt specified since that will
                              // determine how we can interpret the x,y coordinates
                      Severity: Minor
                      Found in src/text/SuperScriptText.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

                      Function Stroke has a Cognitive Complexity of 29 (exceeds 5 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: Minor
                      Found in src/text/GTextTableCell.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

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

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

                      Cognitive Complexity

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

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

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

                      Further reading

                      File FlagImages.php has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

                        Method StrokeLabels has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function StrokeLabels($aPos, $aMinor = false, $aAbsLabel = false)
                            {
                                if (is_array($this->label_color) && safe_count($this->label_color) > 3) {
                                    $this->ticks_label_colors = $this->label_color;
                                    $this->img->SetColor($this->label_color[0]);
                        Severity: Major
                        Found in src/graph/Axis.php - About 4 hrs to fix

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

                              public static function doYearly($aType, $aMinor = false)
                              {
                                  $i = 0;
                                  $j = 0;
                                  $m = self::$startmonth;
                          Severity: Minor
                          Found in src/util/DateScaleUtils.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

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

                              public function AutoScale($img, $min, $max, $maxsteps, $majend = true)
                              {
                                  if (!is_numeric($min) || !is_numeric($max)) {
                                      Util\JpGraphError::Raise(25044);
                                  }
                          Severity: Minor
                          Found in src/graph/LinearScale.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

                          Severity
                          Category
                          Status
                          Source
                          Language