HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

IconPlot has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class IconPlot
{
    public $iX               = 0;
    public $iY               = 0;
    public $iScale           = 1.0;
Severity: Minor
Found in src/plot/IconPlot.php - About 2 hrs to fix

    PlotMark has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class PlotMark
    {
        public $title;
        public $show = true;
        public $type;
    Severity: Minor
    Found in src/plot/PlotMark.php - About 2 hrs to fix

      RotImage has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class RotImage extends Image
      {
          public $a      = 0;
          public $dx     = 0;
          public $dy     = 0;
      Severity: Minor
      Found in src/image/RotImage.php - About 2 hrs to fix

        Method _Stroke has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _Stroke($aImg, $x = null, $y = null, $aReturnWidthHeight = false)
            {
                if ($this->iFile != '' && $this->iCountryFlag != '') {
                    Util\JpGraphError::RaiseL(8003); //('It is not possible to specify both an image file and a country flag for the same icon.');
                }
        Severity: Major
        Found in src/plot/IconPlot.php - About 2 hrs to fix

          Method imageSmoothCircle has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function imageSmoothCircle(&$img, $cx, $cy, $cr, $color)
              {
                  $ir   = $cr;
                  $ix   = 0;
                  $iy   = $ir;
          Severity: Major
          Found in src/image/Image.php - About 2 hrs to fix

            File RadarGraph.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Function GetTextWidth has a Cognitive Complexity of 16 (exceeds 5 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 2 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 GetColWidth has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function GetColWidth($aImg, $aMargin = 0)
                  {
                      $aImg->SetFont($this->iFFamily, $this->iFStyle, $this->iFSize);
                      if (is_array($this->iText)) {
                          $n  = safe_count($this->iText);
              Severity: Minor
              Found in src/text/TextProperty.php - About 2 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 StrokeAxis has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function StrokeAxis($aStrokeLabels = true)
                  {
                      if ($aStrokeLabels) {
                          $this->StrokeAxisLabelBackground();
                      }
              Severity: Minor
              Found in src/graph/Graph.php - About 2 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 GetCSIMareas has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function GetCSIMareas()
                  {
                      if (!$this->iHasStroked) {
                          $this->Stroke(_CSIM_SPECIALFILE);
                      }
              Severity: Minor
              Found in src/graph/Graph.php - About 2 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 AdjDate has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function AdjDate($aTime, $aRound = 0, $aYearType = false, $aMonthType = false, $aDayType = false)
                  {
                      $y = (int) date('Y', $aTime);
                      $m = (int) date('m', $aTime);
                      $d = (int) date('d', $aTime);
              Severity: Major
              Found in src/graph/DateScale.php - About 2 hrs to fix

                Method FilledFlatPolygon has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function FilledFlatPolygon($pts, $from_color, $to_color)
                    {
                        if (safe_count($pts) == 0) {
                            return;
                        }
                Severity: Minor
                Found in src/plot/Gradient.php - About 2 hrs to fix

                  Method doYearly has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function doYearly($aType, $aMinor = false)
                      {
                          $i = 0;
                          $j = 0;
                          $m = self::$startmonth;
                  Severity: Minor
                  Found in src/util/DateScaleUtils.php - About 2 hrs to fix

                    Method DoPattern has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function DoPattern($aImg)
                        {
                            // "Fake" a nice 3D grid-effect.
                            $x0       = $this->rect->x + $this->rect->w / 2;
                            $y0       = $this->rect->y;
                    Severity: Minor
                    Found in src/graph/RectPattern3DPlane.php - About 2 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (($ext == 'jpg' && !($supported & IMG_JPG)) ||
                                  ($ext == 'gif' && !($supported & IMG_GIF)) ||
                                  ($ext == 'png' && !($supported & IMG_PNG)) ||
                                  ($ext == 'bmp' && !($supported & IMG_WBMP)) ||
                                  ($ext == 'xpm' && !($supported & IMG_XPM))) {
                      Severity: Critical
                      Found in src/graph/Graph.php - About 2 hrs to fix

                        Method StrokeLabels has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function StrokeLabels($label, $img, $a, $xp, $yp, $z)
                            {
                                $this->value->halign = 'left';
                                $this->value->valign = 'top';
                        
                        
                        Severity: Minor
                        Found in src/plot/PiePlot3D.php - About 1 hr to fix

                          Method AddSliceToCSIM has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function AddSliceToCSIM($i, $xc, $yc, $radius, $sa, $ea)
                              {
                                  //Slice number, ellipse centre (x,y), height, width, start angle, end angle
                                  while ($sa > 2 * M_PI) {
                                      $sa = $sa - 2 * M_PI;
                          Severity: Minor
                          Found in src/plot/PiePlot.php - About 1 hr to fix

                            Method _StrokeBuiltinFont has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _StrokeBuiltinFont($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $aDebug = false)
                                {
                                    if (is_numeric($dir) && $dir != 90 && $dir != 0) {
                                        Util\JpGraphError::RaiseL(25091);
                                    }
                            Severity: Minor
                            Found in src/image/Image.php - About 1 hr to fix

                              Method imagettfbbox_fixed has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function imagettfbbox_fixed($size, $angle, $fontfile, $text)
                                  {
                                      if (!USE_LIBRARY_IMAGETTFBBOX) {
                                          $bbox = @imagettfbbox($size, $angle, $fontfile, $text);
                                          if ($bbox === false) {
                              Severity: Minor
                              Found in src/image/Image.php - About 1 hr to fix

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

                                    public function Stroke($img, $xscale, $yscale)
                                    {
                                        $ymin = $yscale->scale_abs[0];
                                        if ($yscale->scale[0] < 0) {
                                            $yzero = $yscale->Translate(0);
                                Severity: Minor
                                Found in src/plot/ScatterPlot.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language