HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

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

    public function Stroke($aImg, $aXLeft, $aYTop, $aXRight, $aYBottom, $aUseTextHeight = false)
    {
        if (!$this->iShow) {
            return;
        }
Severity: Major
Found in src/graph/GanttActivityInfo.php - About 2 hrs to fix

    Method Legend has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function Legend($graph)
        {
            if ($this->grad && $this->legend != '' && !$this->fill) {
                $color = [$this->grad_fromcolor, $this->grad_tocolor];
                // In order to differentiate between gradients and cooors specified as an Image\RGB triple
    Severity: Major
    Found in src/plot/BarPlot.php - About 2 hrs to fix

      Method AdjustMarginsForTitles has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function AdjustMarginsForTitles()
          {
              $totrequired =
                  ($this->title->t != ''
                  ? $this->title->GetTextHeight($this->img) + $this->title->margin + 5 * SUPERSAMPLING_SCALE
      Severity: Major
      Found in src/graph/Graph.php - About 2 hrs to fix

        Method doAutoScaleYnAxis has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function doAutoScaleYnAxis()
            {
                if ($this->y2scale != null) {
                    if (!$this->y2scale->IsSpecified() && safe_count($this->y2plots) > 0) {
                        list($min, $max) = $this->GetPlotsYMinMax($this->y2plots);
        Severity: Major
        Found in src/graph/Graph.php - About 2 hrs to fix

          Method Get has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function Get($aSymb, $aCapital = false)
              {
                  $iSymbols = [
                      /* Greek */
                      ['alpha', '03B1', '0391'],
          Severity: Major
          Found in src/graph/SymChar.php - About 2 hrs to fix

            Method _doAutoTickPos has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _doAutoTickPos($aScale)
                {
                    $maj_step_abs = $aScale->scale_factor * $this->major_step;
                    $min_step_abs = $aScale->scale_factor * $this->minor_step;
            
            
            Severity: Major
            Found in src/graph/LinearTicks.php - About 2 hrs to fix

              Function StrokeLabels has a Cognitive Complexity of 17 (exceeds 5 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 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 Stroke has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function Stroke($aImg, $aScale)
                  {
                      // Put the mark in the middle at the middle of the day
                      $d = $aScale->NormalizeDate($this->iStart) + SECPERDAY / 2;
                      $x = $aScale->TranslateDate($d);
              Severity: Minor
              Found in src/plot/MileStone.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 AdjPercentage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function AdjPercentage($aData, $aPrec = 0)
                  {
                      $mul = 100;
                      if ($aPrec > 0 && $aPrec < 3) {
                          if ($aPrec == 1) {
              Severity: Minor
              Found in src/plot/PiePlot.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 doDaily has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function doDaily($aType, $aMinor = false)
                  {
                      $m = self::$startmonth;
                      $y = self::$startyear;
                      $d = self::$startday;
              Severity: Minor
              Found in src/util/DateScaleUtils.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 StrokeYears has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function StrokeYears($aYCoord, $getHeight = false)
                  {
                      if ($this->year->iShowLabels) {
                          $img = $this->iImg;
                          $yt  = $aYCoord + $img->top_margin;
              Severity: Minor
              Found in src/graph/GanttScale.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 Stroke has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function Stroke($pos, $dummy = true)
                  {
                      $this->img->SetLineWeight($this->weight);
                      $this->img->SetColor($this->color);
                      $this->img->SetFont($this->font_family, $this->font_style, $this->font_size);
              Severity: Minor
              Found in src/graph/PolarAxis.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 Legend has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function Legend($graph)
                  {
                      $colors = array_keys($graph->img->rgb->rgb_table);
                      sort($colors);
                      $ta = $this->themearr[$this->theme];
              Severity: Major
              Found in src/plot/PiePlot.php - About 2 hrs to fix

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