HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function tryHexConversion has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function tryHexConversion($aColor)
    {
        if (is_array($aColor)) {
            if (safe_count($aColor) == 3) {
                if (is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2])) {
Severity: Minor
Found in src/util/RGB.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 StrokeLabels has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeLabels($aImg, $xc, $yc, $ri, $rr)
    {
        if ($this->iHideLabels) {
            return;
        }
Severity: Minor
Found in src/graph/WindrosePlotScale.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 GetTextsYMinMax has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetTextsYMinMax($aY2 = false)
    {
        if ($aY2) {
            $txts = $this->y2texts;
        } else {
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 GetLinesYMinMax has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetLinesYMinMax($aLines)
    {
        if (is_null($aLines)) {
            return false;
        }
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 GetTextsXMinMax has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetTextsXMinMax($aY2 = false)
    {
        if ($aY2) {
            $txts = $this->y2texts;
        } else {
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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function Stroke($aStrokeFileName = '')
    {
        if ($this->texts != null) {
            for ($i = 0; $i < safe_count($this->texts); ++$i) {
                $this->texts[$i]->Stroke($this->img);
Severity: Minor
Found in src/graph/CanvasGraph.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 GetMaxLabelWidth has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetMaxLabelWidth()
    {
        $m = 10;
        if ($this->iObj != null) {
            $marg = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin;
Severity: Minor
Found in src/graph/GanttGraph.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 Max has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function Max()
    {
        list($xmax) = $this->plots[0]->Max();
        $nmax       = 0;
        for ($i = 0; $i < safe_count($this->plots); ++$i) {
Severity: Minor
Found in src/plot/AccBarPlot.php - About 1 hr to fix

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

        public function Stroke($img, $xscale, $yscale)
        {
            $numpoints = safe_count($this->coords[0]) / 2;
            $img->SetColor($this->color);
            $img->SetLineWeight($this->weight);
    Severity: Minor
    Found in src/plot/ErrorPlot.php - About 1 hr to fix

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

          public function Stroke($img, $aaoption = 0)
          {
              // Stroke the pie but don't stroke values
              $tmp               = $this->value->show;
              $this->value->show = false;
      Severity: Minor
      Found in src/plot/PiePlotC.php - About 1 hr to fix

        Method GetAutoTicks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function GetAutoTicks($aMin, $aMax, $aMaxTicks = 10, $aMinor = false)
            {
                $diff = $aMax - $aMin;
                $spd  = 3600 * 24;
                $spw  = $spd * 7;
        Severity: Minor
        Found in src/util/DateScaleUtils.php - About 1 hr to fix

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

              public function Set($aArg1, $aArg2 = null, $aArg3 = null)
              {
                  if ($aArg2 === null && $aArg3 === null) {
                      if (is_array($aArg1)) {
                          if (is_array($aArg1[0])) {
          Severity: Minor
          Found in src/text/GTextTable.php - About 1 hr to fix

            Method Calc has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function Calc()
                {
                    $this->icalculated = true;
            
                    $n   = safe_count($this->ix);
            Severity: Minor
            Found in src/util/LinearRegression.php - About 1 hr to fix

              Method CalcTicks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function CalcTicks($maxsteps, $min, $max, $a, $b, $majend = true)
                  {
                      $diff = $max - $min;
                      if ($diff == 0) {
                          $ld = 0;
              Severity: Minor
              Found in src/graph/LinearScale.php - About 1 hr to fix

                Method CheckCSIMCache has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function CheckCSIMCache($aCacheName, $aTimeOut = 60)
                    {
                        global $_SERVER;
                
                        if ($aCacheName == 'auto') {
                Severity: Minor
                Found in src/graph/Graph.php - About 1 hr to fix

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

                      public function Stroke($aImg, $aScale)
                      {
                          if (!$this->iShow) {
                              return;
                          }
                  Severity: Minor
                  Found in src/graph/HorizontalGridLine.php - About 1 hr to fix

                    Method _fileCheck has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function _fileCheck($filename, &$ownFixtures = [], $debug = false)
                        {
                            if (\is_array($filename)) {
                                if (\array_key_exists('width', $filename)) {
                                    $__width = $filename['width'];
                    Severity: Minor
                    Found in tests/UnitTestTrait.php - About 1 hr to fix

                      Method StrokeBackgroundGrad has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method Create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function Create($aPattern, $aColor, $aWeight = 1)
                            {
                                switch ($aPattern) {
                                    case BAND_RDIAG:
                                        $obj = new RectPatternRDiag($aColor, $aWeight);
                        Severity: Minor
                        Found in src/graph/RectPatternFactory.php - About 1 hr to fix

                          Method _normalizeTestGroup has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function _normalizeTestGroup($filename, &$ownFixtures = [], $example_title = 'file_iterator', $debug = false, $attributes = [])
                              {
                                  $filename_meaningful = \explode('ex', $filename)[0];
                          
                                  if ('file_iterator' === $example_title) {
                          Severity: Minor
                          Found in tests/UnitTestTrait.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language