HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method ApplyPlot has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function ApplyPlot($plot)
    {
        switch (get_class($plot)) {
            case 'GroupBarPlot':
                    foreach ($plot->plots as $_plot) {
Severity: Minor
Found in src/themes/VividTheme.php - About 1 hr to fix

    Method GetTextWidth has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function GetTextWidth($txt, $angle = 0)
        {
            $tmp = preg_split('/\n/', $txt);
            $n   = safe_count($tmp);
            if ($this->font_family <= FF_FONT2 + 1) {
    Severity: Minor
    Found in src/image/Image.php - About 1 hr to fix

      Method ApplyPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function ApplyPlot($plot)
          {
              switch (get_class($plot)) {
                  case 'GroupBarPlot':
                          foreach ($plot->plots as $_plot) {
      Severity: Minor
      Found in src/themes/OrangeTheme.php - About 1 hr to fix

        Method StrokeHGrid has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function StrokeHGrid($aImg, $aX, $aY, $aWidth, $aHeight, $aDir = 1)
            {
                // Top or bottom grid line
                // For the left we increase the X-pos and for the right we decrease it. This is
                // determined by the direction argument.
        Severity: Minor
        Found in src/text/GTextTableCell.php - About 1 hr to fix

          Method ApplyPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function ApplyPlot($plot)
              {
                  switch (get_class($plot)) {
                      case 'GroupBarPlot':
                              foreach ($plot->plots as $_plot) {
          Severity: Minor
          Found in src/themes/OceanTheme.php - About 1 hr to fix

            Method ApplyPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function ApplyPlot($plot)
                {
                    switch (get_class($plot)) {
                        case 'GroupBarPlot':
                                foreach ($plot->plots as $_plot) {
            Severity: Minor
            Found in src/themes/AquaTheme.php - About 1 hr to fix

              Method StrokeVGrid has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function StrokeVGrid($aImg, $aX, $aY, $aWidth, $aHeight, $aDir = 1)
                  {
                      // Left or right grid line
                      // For the right we increase the X-pos and for the right we decrease it. This is
                      // determined by the direction argument.
              Severity: Minor
              Found in src/text/GTextTableCell.php - About 1 hr to fix

                Method ApplyPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function ApplyPlot($plot)
                    {
                        switch (get_class($plot)) {
                            case 'GroupBarPlot':
                                    foreach ($plot->plots as $_plot) {
                Severity: Minor
                Found in src/themes/GreenTheme.php - About 1 hr to fix

                  Method ApplyPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function ApplyPlot($plot)
                      {
                          switch (get_class($plot)) {
                              case 'GroupBarPlot':
                                      foreach ($plot->plots as $_plot) {
                  Severity: Minor
                  Found in src/themes/RoseTheme.php - About 1 hr to fix

                    Method __construct has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function __construct($aImg)
                        {
                            $this->iImg        = $aImg;
                            $this->iDateLocale = new Util\DateLocale();
                    
                    
                    Severity: Minor
                    Found in src/graph/GanttScale.php - About 1 hr to fix

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

                          public function Stroke($pos, $aAxisAngle, &$grid, $title, $lf)
                          {
                              $this->img->SetColor($this->color);
                      
                              // Determine end points for the axis
                      Severity: Minor
                      Found in src/graph/RadarAxis.php - About 1 hr to fix

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

                            public function Stroke($aStrokeFileName = '')
                            {
                                if ($this->texts != null) {
                                    for ($i = 0; $i < safe_count($this->texts); ++$i) {
                                        $this->texts[$i]->Stroke($this->img);
                        Severity: Minor
                        Found in src/graph/CanvasGraph.php - About 1 hr to fix

                          Function _SetPatternHelper has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _SetPatternHelper($aPattern, &$aPatternValue, &$aDensity)
                              {
                                  switch ($aPattern) {
                                      case PATTERN_DIAG1:
                                          $aPatternValue = 1;
                          Severity: Minor
                          Found in src/plot/BarPlot.php - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function Pie3DSlice($img, $xc, $yc, $w, $h, $sa, $ea, $z, $fillcolor, $shadow = 0.65)
                          Severity: Major
                          Found in src/plot/PiePlot3D.php - About 1 hr to fix

                            Method CopyMerge has 10 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function CopyMerge($fromImg, $toX, $toY, $fromX, $fromY, $toWidth, $toHeight, $fromWidth = -1, $fromHeight = -1, $aMix = 100)
                            Severity: Major
                            Found in src/image/RotImage.php - About 1 hr to fix

                              Function tryHexConversion has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function tryHexConversion($aColor)
                                  {
                                      if (is_array($aColor)) {
                                          if (safe_count($aColor) == 3) {
                                              if (is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2])) {
                              Severity: Minor
                              Found in src/image/RGB.php - About 1 hr 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 CopyMerge has 10 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function CopyMerge($fromImg, $toX, $toY, $fromX, $fromY, $toWidth, $toHeight, $fromWidth = -1, $fromHeight = -1, $aMix = 100)
                              Severity: Major
                              Found in src/image/Image.php - About 1 hr to fix

                                Method CopyCanvasH has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public function CopyCanvasH($aToHdl, $aFromHdl, $aToX, $aToY, $aFromX, $aFromY, $aWidth, $aHeight, $aw = -1, $ah = -1)
                                Severity: Major
                                Found in src/image/Image.php - About 1 hr to fix

                                  Function FastStroke has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function FastStroke($img, $xscale, $yscale, $aStartPoint = 0, $exist_x = true)
                                      {
                                          // An optimized stroke for many data points with no extra
                                          // features but 60% faster. You can't have values or line styles, or null
                                          // values in plots.
                                  Severity: Minor
                                  Found in src/plot/LinePlot.php - About 1 hr 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 Polygon has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function Polygon($p, $closed = false, $fast = false)
                                      {
                                          if ($this->line_weight <= 0) {
                                              return;
                                          }
                                  Severity: Minor
                                  Found in src/image/Image.php - About 1 hr 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