HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function Raise has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function Raise($aMsg, $aHalt = false)
    {
        if ($this->iDest != '') {
            if ($this->iDest == 'syslog') {
                error_log($this->iTitle . $aMsg);
Severity: Minor
Found in src/util/JpGraphErrObject.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 _autoSizeTable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _autoSizeTable($aImg)
    {
        // Get maximum column width and row height
        $m = $this->iSize[0];
        $n = $this->iSize[1];
Severity: Minor
Found in src/text/GTextTable.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 GetPlotsYMinMax has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetPlotsYMinMax($bPlots)
    {
        $aPlots = array_filter($bPlots, function ($plot) {
            //\Kint::dump($plot, $plot instanceof Plot\Plot);
            return $plot instanceof Plot\Plot;
Severity: Minor
Found in src/graph/Graph.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 DisplayClientSideaImageMapAreas has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function DisplayClientSideaImageMapAreas()
    {
        // Debug stuff - display the outline of the image map areas
        $csim = '';
        foreach ($this->plots as $p) {
Severity: Minor
Found in src/graph/Graph.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 Stroke has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function Stroke($img, $grid)
    {
        if (!$this->show) {
            return;
        }
Severity: Minor
Found in src/graph/RadarGrid.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 DisplayCSIMAreas has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function DisplayCSIMAreas()
    {
        $csim = '';
        foreach ($this->plots as $p) {
            $csim .= $p->GetCSIMareas();
Severity: Minor
Found in src/graph/PieGraph.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 AutoScale has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function AutoScale($img, $min, $max, $maxsteps, $majend = true)
    {
        if ($min == 0) {
            $min = 1;
        }
Severity: Minor
Found in src/graph/LogScale.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 StyleLine has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function StyleLine($x1, $y1, $x2, $y2, $aStyle = '', $from_grid_class = false)
    {
        if ($this->line_weight <= 0) {
            return;
        }
Severity: Minor
Found in src/image/Image.php - About 1 hr to fix

    Method ApplyPlot has 35 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/UniversalTheme.php - About 1 hr to fix

      Method StrokeFullSliceFrame has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function StrokeFullSliceFrame($img, $xc, $yc, $sa, $ea, $w, $h, $z, $edgecolor, $exploderadius, $fulledge)
      Severity: Major
      Found in src/plot/PiePlot3D.php - About 1 hr to fix

        Method _imageSmoothArcDrawSegment has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private function _imageSmoothArcDrawSegment(&$img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $seg)
        Severity: Major
        Found in src/image/Image.php - About 1 hr to fix

          Method Set has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function Set($aLocale)
              {
                  if (in_array($aLocale, array_keys($this->iDayAbb), true)) {
                      $this->iLocale = $aLocale;
          
          
          Severity: Minor
          Found in src/util/DateLocale.php - About 1 hr to fix

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

                public function Stroke($aImg)
                {
                    list($dx, $dy) = $this->isizespec[$this->iSize];
                    $x             = $this->ix;
                    $y             = $this->iy;
            Severity: Minor
            Found in src/image/LinkArrow.php - About 1 hr to fix

              Method SetTickDensity has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function SetTickDensity($aYDensity = TICKD_NORMAL, $aXDensity = TICKD_NORMAL)
                  {
                      $this->xtick_factor = 30;
                      $this->ytick_factor = 25;
                      switch ($aYDensity) {
              Severity: Minor
              Found in src/graph/Graph.php - About 1 hr to fix

                Method StrokeTableHeaders has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function StrokeTableHeaders($aYBottom)
                    {
                        $img = $this->iImg;
                        $xt  = $img->left_margin;
                        $yt  = $img->top_margin;
                Severity: Minor
                Found in src/graph/GanttScale.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (($this->yaxis->pos == $this->xscale->GetMinVal() || (is_string($this->yaxis->pos) && $this->yaxis->pos == 'min')) &&
                              !is_numeric($this->xaxis->pos) && $this->yscale->GetMinVal() < 0 &&
                              substr($this->axtype, 0, 4) != 'text' && $this->xaxis->pos != 'min') {
                              //$this->yscale->ticks->SupressZeroLabel(false);
                              $this->xscale->ticks->SupressFirst();
                  Severity: Critical
                  Found in src/graph/Graph.php - About 1 hr to fix

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

                        public function Legend($graph)
                        {
                            if ($this->legend != '') {
                                if ($this->filled && !$this->fillgrad) {
                                    $graph->legend->Add(
                    Severity: Minor
                    Found in src/plot/LinePlot.php - About 1 hr to fix

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

                          public function _GetLED($aLedIdx, $aColor = 0)
                          {
                              $width  = $this->iLED_X * $this->iRad * 2 + ($this->iLED_X + 1) * $this->iMarg + $this->iRad;
                              $height = $this->iLED_Y * $this->iRad * 2 + ($this->iLED_Y) * $this->iMarg + $this->iRad * 2;
                      
                      
                      Severity: Minor
                      Found in src/image/DigitalLED74.php - About 1 hr to fix

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

                            public function GetPoint($mu)
                            {
                                $n     = $this->n - 1;
                                $k     = 0;
                                $kn    = 0;
                        Severity: Minor
                        Found in src/util/Bezier.php - About 1 hr to fix

                          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/PastelTheme.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language