HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Method CopyCanvasH has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function CopyCanvasH($aToHdl, $aFromHdl, $aToX, $aToY, $aFromX, $aFromY, $aWidth, $aHeight, $aw = -1, $ah = -1)
Severity: Major
Found in src/image/Image.php - About 1 hr to fix

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

        public function FastStroke($img, $xscale, $yscale, $aStartPoint = 0, $exist_x = true)
        {
            // An optimized stroke for many data points with no extra
            // features but 60% faster. You can't have values or line styles, or null
            // values in plots.
    Severity: Minor
    Found in src/plot/LinePlot.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 CopyMerge has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function CopyMerge($fromImg, $toX, $toY, $fromX, $fromY, $toWidth, $toHeight, $fromWidth = -1, $fromHeight = -1, $aMix = 100)
    Severity: Major
    Found in src/image/Image.php - About 1 hr to fix

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