HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Method DrawLine has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color)
    {
        if ($weight == 1) {
            return imageline($im, $x1, $y1, $x2, $y2, $color);
        }
Severity: Major
Found in src/image/Image.php - About 2 hrs to fix

    Method AdjustMarginsForGrid has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function AdjustMarginsForGrid()
        {
            if ($this->iCol > 0) {
                switch ($this->iGridStyle[0]) {
                    case TGRID_SINGLE:
    Severity: Major
    Found in src/text/GTextTableCell.php - About 2 hrs to fix

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

          public function Stroke($aImg, $aX, $aY)
          {
              if ($this->iShow) {
                  $aImg->SetColor($this->iColor);
                  $aImg->SetFont($this->iFFamily, $this->iFStyle, $this->iFSize);
      Severity: Major
      Found in src/text/TextProperty.php - About 2 hrs to fix

        Method FromCSV2 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function FromCSV2($aFile, &$aData, $aOptions = [])
            {
                $aDefaults = [
                    'separator'    => ',',
                    'enclosure'    => chr(34),
        Severity: Major
        Found in src/util/ReadFileData.php - About 2 hrs to fix

          Method StrokeYears has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function StrokeYears($aYCoord, $getHeight = false)
              {
                  if ($this->year->iShowLabels) {
                      $img = $this->iImg;
                      $yt  = $aYCoord + $img->top_margin;
          Severity: Major
          Found in src/graph/GanttScale.php - About 2 hrs to fix

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

                public function Stroke($aImg, &$grid, $aPos, $aAxisAngle, $aScale, &$aMajPos, &$aMajLabel)
                {
                    // Prepare to draw linear ticks
                    $maj_step_abs = abs($aScale->scale_factor * $this->major_step);
                    $min_step_abs = abs($aScale->scale_factor * $this->minor_step);
            Severity: Major
            Found in src/graph/RadarLinearTicks.php - About 2 hrs to fix

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

                  public function Stroke($aImg, $scale)
                  {
                      // If coordinates are specifed as negative this means we should
                      // treat them as abolsute (pixels) coordinates
                      if ($this->ix > 0) {
              Severity: Major
              Found in src/text/CanvasRectangleText.php - About 2 hrs to fix

                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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language