HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method Pie3D has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $aaoption,
        $img,
        $data,
        $colors,
        $xc,
Severity: Major
Found in src/plot/PiePlot3D.php - About 1 hr to fix

    Method Stroke has 40 lines of code (exceeds 25 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 1 hr to fix

      Method doWeekly has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function doWeekly($aType, $aMinor = false)
          {
              $hpd = 3600 * 24;
              $hpw = 3600 * 24 * 7;
              // Find out week number of min date
      Severity: Minor
      Found in src/util/DateScaleUtils.php - About 1 hr to fix

        Method DoPattern has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function DoPattern($aImg)
            {
                //  --------------------
                //  |\   \   \   \   \ |
                //  | \   \   \   \   \|
        Severity: Minor
        Found in src/graph/RectPatternLDiag.php - About 1 hr to fix

          Function CalculateColors has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function CalculateColors()
              {
                  if ($this->highcontrast) {
                      if ($this->highcontrastbw) {
                          for ($ib = 0; $ib < $this->nbrIsobars; ++$ib) {
          Severity: Minor
          Found in src/plot/Contour.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 SetPattern has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function SetPattern($aPattern, $aColor = 'black')
              {
                  if (is_array($aPattern)) {
                      $n                     = safe_count($aPattern);
                      $this->iPattern        = [];
          Severity: Minor
          Found in src/plot/BarPlot.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 AddSliceToCSIM has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function AddSliceToCSIM($i, $xc, $yc, $radius, $sa, $ea)
              {
                  //Slice number, ellipse centre (x,y), radius, start angle, end angle
                  while ($sa > 2 * M_PI) {
                      $sa = $sa - 2 * M_PI;
          Severity: Minor
          Found in src/plot/PiePlotC.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 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _Stroke($aImg, $x = null, $y = null, $aReturnWidthHeight = false)
              {
                  if ($this->iFile != '' && $this->iCountryFlag != '') {
                      Util\JpGraphError::RaiseL(8003); //('It is not possible to specify both an image file and a country flag for the same icon.');
                  }
          Severity: Minor
          Found in src/plot/IconPlot.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 13 (exceeds 5 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

          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 doWeekly has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function doWeekly($aType, $aMinor = false)
              {
                  $hpd = 3600 * 24;
                  $hpw = 3600 * 24 * 7;
                  // Find out week number of min date
          Severity: Minor
          Found in src/util/DateScaleUtils.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 imageSmoothCircle has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function imageSmoothCircle(&$img, $cx, $cy, $cr, $color)
              {
                  $ir   = $cr;
                  $ix   = 0;
                  $iy   = $ir;
          Severity: Minor
          Found in src/image/Image.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 imagettfbbox_fixed has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function imagettfbbox_fixed($size, $angle, $fontfile, $text)
              {
                  if (!USE_LIBRARY_IMAGETTFBBOX) {
                      $bbox = @imagettfbbox($size, $angle, $fontfile, $text);
                      if ($bbox === false) {
          Severity: Minor
          Found in src/image/Image.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 GetAutoTicks has a Cognitive Complexity of 13 (exceeds 5 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

          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 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function Stroke($aImg, $aDummy1 = null, $aDummy2 = null)
              {
                  if ($this->hide) {
                      return;
                  }
          Severity: Minor
          Found in src/text/GraphTabTitle.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 SetFont has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function SetFont()
              {
                  $numargs = func_num_args();
                  if ($numargs == 2 || $numargs == 3) {
                      $aFF = func_get_arg(0);
          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 CheckCSIMCache has a Cognitive Complexity of 13 (exceeds 5 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

          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 StrokeBands has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function StrokeBands($aDepth, $aCSIM)
              {
                  // Stroke bands
                  if ($this->bands != null && !$aCSIM) {
                      for ($i = 0; $i < safe_count($this->bands); ++$i) {
          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 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function Stroke($aImg, $aXLeft, $aYTop, $aXRight, $aYBottom, $aUseTextHeight = false)
              {
                  if (!$this->iShow) {
                      return;
                  }
          Severity: Minor
          Found in src/graph/GanttActivityInfo.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 Add3DSliceToCSIM has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function Add3DSliceToCSIM($i, $xc, $yc, $height, $width, $thick, $sa, $ea)
              {
                  //Slice number, ellipse centre (x,y), height, width, start angle, end angle
          
                  $sa *= M_PI / 180;
          Severity: Minor
          Found in src/plot/PiePlot3D.php - About 1 hr to fix

            Method StrokeFullSliceFrame has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function StrokeFullSliceFrame($img, $xc, $yc, $sa, $ea, $w, $h, $z, $edgecolor, $exploderadius, $fulledge)
                {
                    $step = 0.02;
            
                    if ($exploderadius > 0) {
            Severity: Minor
            Found in src/plot/PiePlot3D.php - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language