HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function DoStroke has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function DoStroke($aTicksPos, $aType, $aColor, $aWeight)
    {
        $nbrgrids = safe_count($aTicksPos);
        if (!$this->show || $nbrgrids === 0) {
            return;
Severity: Minor
Found in src/graph/Grid.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 prod.inc.php has 360 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

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

    Method Stroke has 116 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/PieGraph.php - About 4 hrs to fix

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

          public function Stroke($img, $aVal, $x, $y)
          {
              if ($this->show) {
                  if ($this->negformat == '') {
                      $this->negformat = $this->format;
      Severity: Minor
      Found in src/plot/DisplayValue.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 AccBarPlot.php has 355 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

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

            public function Stroke($img, $scale, $pos)
            {
                $start     = $scale->GetMinVal();
                $limit     = $scale->GetMaxVal();
                $nextMajor = 10 * $start;
        Severity: Major
        Found in src/graph/LogTicks.php - About 4 hrs to fix

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

              public function Stroke($aGraph)
              {
                  $aImg = $aGraph->img;
          
                  if ($this->iX > 0 && $this->iX < 1) {
          Severity: Major
          Found in src/plot/WindrosePlot.php - About 4 hrs to fix

            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

                                Severity
                                Category
                                Status
                                Source
                                Language