HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function Add has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function Add($aObj)
    {
        if (is_array($aObj) && safe_count($aObj) > 0) {
            $cl = $aObj[0];
        } else {
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 Init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function Init()
    {
        // Setup limits for color indications
        $lowx   = $this->iXMin;
        $highx  = $this->iXMax;
Severity: Minor
Found in src/graph/CCBPGraph.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 Stroke has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function Stroke($img, $aVal, $x, $y)
    {
        if ($this->show) {
            if ($this->negformat == '') {
                $this->negformat = $this->format;
Severity: Minor
Found in src/plot/DisplayValue.php - About 1 hr to fix

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

        public function Get($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
        {
            global $__jpg_err_locale;
            if (!isset($this->lt[$errnbr])) {
                return 'Internal error: The specified error message (' . $errnbr . ') does not exist in the chosen locale (' . $__jpg_err_locale . ')';
    Severity: Minor
    Found in src/util/ErrMsgText.php - About 1 hr to fix

      Method SetupGraph has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function SetupGraph($graph)
          {
              // graph
              $graph->SetFrame(false);
              $graph->SetMarginColor('white');
      Severity: Minor
      Found in src/themes/SoftyTheme.php - About 1 hr to fix

        Method _doLabelFormat has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _doLabelFormat($aVal, $aIdx, $aNbrTicks)
            {
                // If precision hasn't been specified set it to a sensible value
                if ($this->precision == -1) {
                    $t = log10($this->minor_step);
        Severity: Minor
        Found in src/graph/LinearTicks.php - About 1 hr to fix

          Method LineInterpolate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function LineInterpolate(&$aData)
              {
                  $n = safe_count($aData);
                  $i = 0;
          
          
          Severity: Minor
          Found in src/plot/AccLinePlot.php - About 1 hr to fix

            Method StrokeFrame has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function StrokeFrame()
                {
                    if (!$this->doframe) {
                        return;
                    }
            Severity: Minor
            Found in src/graph/Graph.php - About 1 hr to fix

              Method GetCSIMareas has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function GetCSIMareas()
                  {
                      if (!$this->iHasStroked) {
                          $this->Stroke(_CSIM_SPECIALFILE);
                      }
              Severity: Minor
              Found in src/graph/Graph.php - About 1 hr to fix

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

                    public function Stroke($img, $pos, $scale, $startangle)
                    {
                        $nbrpnts = safe_count($this->data);
                        $astep   = 2 * M_PI / $nbrpnts;
                        $a       = $startangle;
                Severity: Minor
                Found in src/plot/RadarPlot.php - About 1 hr to fix

                  Method imageSmoothArc has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, $start, $stop)
                      {
                          // Originally written from scratch by Ulrich Mierendorff, 06/2006
                          // Rewritten and improved, 04/2007, 07/2007
                          // compared to old version:
                  Severity: Minor
                  Found in src/image/Image.php - About 1 hr to fix

                    Method Color has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function Color($aColor)
                        {
                            if (is_string($aColor)) {
                                $matches = [];
                                // this regex will parse a color string and fill the $matches array as such:
                    Severity: Minor
                    Found in src/util/RGB.php - About 1 hr to fix

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

                          public function Stroke($img, $pos, $scale, $startangle)
                          {
                              $nbrpnts = safe_count($this->data);
                              $astep   = 2 * M_PI / $nbrpnts;
                              $a       = $startangle;
                      Severity: Minor
                      Found in src/graph/RadarGrid.php - About 1 hr to fix

                        Method SetScale has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
                            {
                                $this->axtype = $aAxisType;
                        
                                if ($aYMax < $aYMin || $aXMax < $aXMin) {
                        Severity: Minor
                        Found in src/graph/Graph.php - About 1 hr to fix

                          Method _StrokeAxisTitle has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _StrokeAxisTitle($pos, $aAxisAngle, $title)
                              {
                                  $this->title->Set($title);
                                  $marg = 6 + $this->title->margin;
                                  $xt   = round(($this->scale->world_abs_size + $marg) * cos($aAxisAngle) + $this->scale->scale_abs[0]);
                          Severity: Minor
                          Found in src/graph/RadarAxis.php - About 1 hr to fix

                            Method _SetPatternHelper has 44 lines of code (exceeds 25 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

                              Method GetWidth has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function GetWidth($aImg, $aUseTabs = false, $aTabExtraMargin = 1.1)
                                  {
                                      $extra_margin = 4;
                                      $aImg->SetFont($this->iFFamily, $this->iFStyle, $this->iFSize);
                                      if (is_string($this->iText)) {
                              Severity: Minor
                              Found in src/text/TextProperty.php - About 1 hr to fix

                                Function Min has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function Min()
                                    {
                                        if (isset($this->coords[1])) {
                                            $x = $this->coords[1];
                                        } else {
                                Severity: Minor
                                Found in src/plot/Plot.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 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function Stroke($img, $pos, $scale, $startangle)
                                    {
                                        $nbrpnts = safe_count($this->data);
                                        $astep   = 2 * M_PI / $nbrpnts;
                                        $a       = $startangle;
                                Severity: Minor
                                Found in src/plot/RadarPlot.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 Max has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function Max()
                                    {
                                        if (isset($this->coords[1])) {
                                            $x = $this->coords[1];
                                        } else {
                                Severity: Minor
                                Found in src/plot/Plot.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