HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method AddSliceToCSIM has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function AddSliceToCSIM($i, $xc, $yc, $radius, $sa, $ea)
Severity: Minor
Found in src/plot/PiePlot.php - About 45 mins to fix

    Method StrokeLabel has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function StrokeLabel($label, $img, $xc, $yc, $a, $r)
    Severity: Minor
    Found in src/plot/PiePlot.php - About 45 mins to fix

      Function _StrokeLegend has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _StrokeLegend($aImg, $x, $y, $scaling = 1, $aReturnWidth = false)
          {
              if (!$this->legend->iShow) {
                  return 0;
              }
      Severity: Minor
      Found in src/plot/WindrosePlot.php - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                                      if (abs($a3 - $a2) >= $tresh_hold) {
                                          ++$clusters[$cidx][1];
                                          ++$i;
                                      }
      Severity: Major
      Found in src/plot/PiePlot.php - About 45 mins to fix

        Method Arc has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function Arc($xc, $yc, $w, $h, $s, $e)
        Severity: Minor
        Found in src/image/RotImage.php - About 45 mins to fix

          Method StrokeText has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function StrokeText($x, $y, $txt, $dir = 0, $paragraph_align = 'left', $debug = false)
          Severity: Minor
          Found in src/image/RotImage.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ($numcolors == 0) {
                                            Util\JpGraphError::RaiseL(2013); //('You have specified an empty array for shadow colors in the bar plot.');
                                        }
            Severity: Major
            Found in src/plot/AccBarPlot.php - About 45 mins to fix

              Method Get has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function Get($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
              Severity: Minor
              Found in src/util/ErrMsgText.php - About 45 mins to fix

                Method Arc has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function Arc($cx, $cy, $w, $h, $s, $e)
                Severity: Minor
                Found in src/image/Image.php - About 45 mins to fix

                  Method StyleLine has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function StyleLine($x1, $y1, $x2, $y2, $aStyle = '', $from_grid_class = false)
                  Severity: Minor
                  Found in src/image/Image.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ($accy > 0) {
                                                $sp[4]  = $pts[4] + $ssh;
                                                $sp[5]  = $pts[5] - $ssv;
                                                $sp[6]  = $pts[2] + $ssh;
                                                $sp[7]  = $pts[3] - $ssv;
                    Severity: Major
                    Found in src/plot/AccBarPlot.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ($a5 !== null) {
                                                  $argv[$j++] = $a5;
                                              }
                      Severity: Major
                      Found in src/util/ErrMsgText.php - About 45 mins to fix

                        Method StrokeText has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function StrokeText($x, $y, $txt, $dir = 0, $paragraph_align = 'left', $debug = false)
                        Severity: Minor
                        Found in src/image/Image.php - About 45 mins to fix

                          Method FilledCakeSlice has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function FilledCakeSlice($cx, $cy, $w, $h, $s, $e)
                          Severity: Minor
                          Found in src/image/Image.php - About 45 mins to fix

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

                                public function Stroke()
                                {
                                    $n = strlen($this->iData);
                                    if ($n == 0) {
                                        return false;
                            Severity: Minor
                            Found in src/image/AntiSpam.php - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function __construct($errcode, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
                            Severity: Minor
                            Found in src/util/JpGraphExceptionL.php - About 45 mins to fix

                              Method DashedLine has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function DashedLine($x1, $y1, $x2, $y2, $dash_length = 1, $dash_space = 4)
                              Severity: Minor
                              Found in src/image/Image.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (!$aaStopX) {
                                                            imagesetpixel($img, $cx + $xp * ($x1 - 1) + $xa, $cy + $yp * ($y) + $ya, $diffColor1);
                                                        }
                                Severity: Major
                                Found in src/image/Image.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (!empty($this->plots[$j]->csimalts[$i])) {
                                                              $sval = sprintf($this->plots[$j]->csimalts[$i], $this->plots[$j]->coords[0][$i]);
                                                              $this->csimareas .= " title=\"${sval}\" ";
                                                          }
                                  Severity: Major
                                  Found in src/plot/AccBarPlot.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (!empty($this->plots[$j]->csimwintargets[$i])) {
                                                                $this->csimareas .= ' target="' . $this->plots[$j]->csimwintargets[$i] . '" ';
                                                            }
                                    Severity: Major
                                    Found in src/plot/AccBarPlot.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language