HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function PutAndStream has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    public function PutAndStream($aImage, $aCacheFileName, $aInline, $aStrokeFileName)
    {
        // Check if we should always stroke the image to a file
        if (_FORCE_IMGTOFILE) {
            $aStrokeFileName = _FORCE_IMGDIR . Util\Helper::GenImgName();
Severity: Minor
Found in src/image/ImgStreamCache.php - About 6 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 doMonthly has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    public static function doMonthly($aType, $aMinor = false)
    {
        $monthcount = 0;
        $m          = self::$startmonth;
        $y          = self::$startyear;
Severity: Minor
Found in src/util/DateScaleUtils.php - About 6 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 StrokeMinutes has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeMinutes($aYCoord, $getHeight = false)
    {
        $img = $this->iImg;
        $xt  = $img->left_margin + $this->iLabelWidth;
        $yt  = $aYCoord + $img->top_margin;
Severity: Minor
Found in src/graph/GanttScale.php - About 6 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 StrokeAngleLabels has 168 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function StrokeAngleLabels($pos, $type)
    {
        if (!$this->show_angle_label) {
            return;
        }
Severity: Major
Found in src/graph/PolarAxis.php - About 6 hrs to fix

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

        public function Stroke($img, $aaoption = 0)
        {
            // aaoption is used to handle antialias
            // aaoption == 0 a normal pie
            // aaoption == 1 just the body
    Severity: Major
    Found in src/plot/PiePlot.php - About 6 hrs to fix

      File LinearScale.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Method StrokeGuideLabels has 166 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function StrokeGuideLabels($img, $xc, $yc, $radius)
            {
                $n = safe_count($this->labels);
        
                /**
        Severity: Major
        Found in src/plot/PiePlot.php - About 6 hrs to fix

          Function Stroke has a Cognitive Complexity of 42 (exceeds 5 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: Minor
          Found in src/graph/RadarGraph.php - About 6 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

          GanttScale has 46 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class GanttScale
          {
              public $minute;
              public $hour;
              public $day;
          Severity: Minor
          Found in src/graph/GanttScale.php - About 6 hrs to fix

            File PlotMark.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Function Pie3DSlice has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function Pie3DSlice($img, $xc, $yc, $w, $h, $sa, $ea, $z, $fillcolor, $shadow = 0.65)
                  {
                      // Due to the way the 3D Pie algorithm works we are
                      // guaranteed that any slice we get into this method
                      // belongs to either the left or right side of the
              Severity: Minor
              Found in src/plot/PiePlot3D.php - About 6 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 LineInterpolate has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function LineInterpolate(&$aData)
                  {
                      $n = safe_count($aData);
                      $i = 0;
              
              
              Severity: Minor
              Found in src/plot/AccLinePlot.php - About 6 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 Pie3DSlice has 155 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function Pie3DSlice($img, $xc, $yc, $w, $h, $sa, $ea, $z, $fillcolor, $shadow = 0.65)
                  {
                      // Due to the way the 3D Pie algorithm works we are
                      // guaranteed that any slice we get into this method
                      // belongs to either the left or right side of the
              Severity: Major
              Found in src/plot/PiePlot3D.php - About 6 hrs to fix

                Function getIsobars has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getIsobars()
                    {
                        $this->adjustDataPointValues();
                
                        for ($isobar = 0; $isobar < $this->nbrIsobars; ++$isobar) {
                Severity: Minor
                Found in src/plot/Contour.php - About 6 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 _doLabelFormat has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function _doLabelFormat($aVal, $aIdx, $aNbrTicks)
                    {
                        // If precision hasn't been specified set it to a sensible value
                        if ($this->precision == -1) {
                            $t = log10($this->minor_step);
                Severity: Minor
                Found in src/graph/LinearTicks.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 PolarAxis.php has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Function Stroke has a Cognitive Complexity of 38 (exceeds 5 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: Minor
                  Found in src/image/GanttLink.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 doAutoScaleYnAxis has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function doAutoScaleYnAxis()
                      {
                          if ($this->y2scale != null) {
                              if (!$this->y2scale->IsSpecified() && safe_count($this->y2plots) > 0) {
                                  list($min, $max) = $this->GetPlotsYMinMax($this->y2plots);
                  Severity: Minor
                  Found in src/graph/Graph.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 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
                      Severity
                      Category
                      Status
                      Source
                      Language