HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

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/RotImage.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

      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

        Avoid deeply nested control flow statements.
        Open

                                    if (!($y == self::$endyear && $m > self::$endmonth)) {
                                        self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                    }
        Severity: Major
        Found in src/util/DateScaleUtils.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if ($m <= $stopmonth) {
                                          if (!($y == self::$endyear && $m == $stopmonth && self::$endday < 15)) {
                                              self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 15, $y);
                                          }
                                      }
          Severity: Major
          Found in src/util/DateScaleUtils.php - About 45 mins to fix

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

                public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
            Severity: Minor
            Found in src/text/GTextTable.php - About 45 mins to fix

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

                  public function MergeCells($aR1, $aC1, $aR2, $aC2, $aHAlign = 'center', $aVAlign = 'center')
              Severity: Minor
              Found in src/text/GTextTable.php - About 45 mins to fix

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

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

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

                      public function CalcTicks($maxsteps, $min, $max, $a, $b, $majend = true)
                  Severity: Minor
                  Found in src/graph/LinearScale.php - About 45 mins to fix

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

                        public static function GenImgName()
                        {
                            // Determine what format we should use when we save the images
                            $supported = imagetypes();
                            if ($supported & IMG_PNG) {
                    Severity: Minor
                    Found in src/util/Helper.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 StrokeVGrid has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function StrokeVGrid($aImg, $aX, $aY, $aWidth, $aHeight, $aDir = 1)
                    Severity: Minor
                    Found in src/text/GTextTableCell.php - About 45 mins to fix

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

                          public function SetCellCountryFlag($aRow, $aCol, $aFlag, $aScale = 1.0, $aMix = 100, $aStdSize = 3)
                      Severity: Minor
                      Found in src/text/GTextTable.php - About 45 mins to fix

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

                            public function StrokeHGrid($aImg, $aX, $aY, $aWidth, $aHeight, $aDir = 1)
                        Severity: Minor
                        Found in src/text/GTextTableCell.php - About 45 mins to fix

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

                              public function GetWidth($aImg)
                              {
                                  if ($this->iIcon !== null) {
                                      if ($this->iIconConstrain[0] == TIMG_WIDTH) {
                                          $this->iIcon->SetScale(1);
                          Severity: Minor
                          Found in src/text/GTextTableCell.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

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

                              public function SetFillColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
                              {
                                  if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
                                      $this->_chkR($aArgR1);
                                      $this->_chkC($aC1);
                          Severity: Minor
                          Found in src/text/GTextTable.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 ($this->ynscale[$i]->ticks->label_formatstr == '' && $this->ynscale[$i]->ticks->label_dateformatstr == '') {
                                                      $this->ynscale[$i]->ticks->precision = abs(floor(log10(abs(floor($min) - $min)))) + 1;
                                                  }
                          Severity: Major
                          Found in src/graph/Graph.php - About 45 mins to fix

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

                                public function AddY($aN, $aPlot)
                                {
                                    if ($aPlot == null) {
                                        Util\JpGraphError::RaiseL(25012); //("Graph::AddYN() You tried to add a null plot to the graph.");
                                    }
                            Severity: Minor
                            Found in src/graph/Graph.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 SetFrameBevel has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function SetFrameBevel($aDepth = 3, $aBorder = false, $aBorderColor = 'black', $aColor1 = 'white@0.4', $aColor2 = 'darkgray@0.4', $aFlg = true)
                            Severity: Minor
                            Found in src/graph/Graph.php - About 45 mins to fix

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

                                  public function GetMonthLabel($aMonthNbr, $year)
                                  {
                                      $sn = $this->iDateLocale->GetShortMonthName($aMonthNbr);
                                      $ln = $this->iDateLocale->GetLongMonthName($aMonthNbr);
                                      switch ($this->month->iStyle) {
                              Severity: Minor
                              Found in src/graph/GanttScale.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

                                                      switch ($this->minute->iStyle) {
                                                          case MINUTESTYLE_CUSTOM:
                                                              $txt = date($this->minute->iLabelFormStr, $datestamp);
                              
                                                              break;
                              Severity: Major
                              Found in src/graph/GanttScale.php - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language