HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method _TransVert3D has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _TransVert3D($aGdImg, $aHorizon = 100, $aSkewDist = 120, $aDir = SKEW3D_DOWN, $aMinSize = true, $aFillColor = '#FFFFFF', $aQuality = false, $aBorder = false, $aHorizonPos = 0.5)
    {
        // Parameter check
        if ($aHorizonPos < 0 || $aHorizonPos > 1.0) {
            Util\JpGraphError::RaiseL(9001);
Severity: Major
Found in src/image/ImgTrans.php - About 2 hrs to fix

    Method doMonthly has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function doMonthly($aType, $aMinor = false)
        {
            $monthcount = 0;
            $m          = self::$startmonth;
            $y          = self::$startyear;
    Severity: Major
    Found in src/util/DateScaleUtils.php - About 2 hrs to fix

      Method StrokeAxis has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function StrokeAxis($aStrokeLabels = true)
          {
              if ($aStrokeLabels) {
                  $this->StrokeAxisLabelBackground();
              }
      Severity: Major
      Found in src/graph/Graph.php - About 2 hrs to fix

        LinearScale has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class LinearScale
        {
            public $textscale = false; // Just a flag to let the Plot class find out if
            // we are a textscale or not. This is a cludge since
            // this information is available in Graph::axtype but
        Severity: Minor
        Found in src/graph/LinearScale.php - About 2 hrs to fix

          Method AddSliceToCSIM has 62 lines of code (exceeds 25 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: Major
          Found in src/plot/PiePlotC.php - About 2 hrs to fix

            Method AutoScale has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
                {
                    // We need to have one dummy argument to make the signature of AutoScale()
                    // identical to LinearScale::AutoScale
                    if ($aStartTime == $aEndTime) {
            Severity: Major
            Found in src/graph/DateScale.php - About 2 hrs to fix

              Method getIsobars has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getIsobars()
                  {
                      $this->adjustDataPointValues();
              
                      for ($isobar = 0; $isobar < $this->nbrIsobars; ++$isobar) {
              Severity: Major
              Found in src/plot/Contour.php - About 2 hrs to fix

                Method _TransHor3D has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _TransHor3D($aGdImg, $aHorizon = 100, $aSkewDist = 120, $aDir = SKEW3D_LEFT, $aMinSize = true, $aFillColor = '#FFFFFF', $aQuality = false, $aBorder = false, $aHorizonPos = 0.5)
                    {
                        $w = imagesx($aGdImg);
                        $h = imagesy($aGdImg);
                
                
                Severity: Major
                Found in src/image/ImgTrans.php - About 2 hrs to fix

                  Function FilledFlatPolygon has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function FilledFlatPolygon($pts, $from_color, $to_color)
                      {
                          if (safe_count($pts) == 0) {
                              return;
                          }
                  Severity: Minor
                  Found in src/plot/Gradient.php - About 2 hrs 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 StrokeBoxedText has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function StrokeBoxedText(
                          $x,
                          $y,
                          $txt,
                          $dir = 0,
                  Severity: Minor
                  Found in src/image/Image.php - About 2 hrs 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 StrokeHGrid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function StrokeHGrid($aImg, $aX, $aY, $aWidth, $aHeight, $aDir = 1)
                      {
                          // Top or bottom grid line
                          // For the left we increase the X-pos and for the right we decrease it. This is
                          // determined by the direction argument.
                  Severity: Minor
                  Found in src/text/GTextTableCell.php - About 2 hrs 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 StrokeVGrid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function StrokeVGrid($aImg, $aX, $aY, $aWidth, $aHeight, $aDir = 1)
                      {
                          // Left or right grid line
                          // For the right we increase the X-pos and for the right we decrease it. This is
                          // determined by the direction argument.
                  Severity: Minor
                  Found in src/text/GTextTableCell.php - About 2 hrs 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 FromCSV2 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function FromCSV2($aFile, &$aData, $aOptions = [])
                      {
                          $aDefaults = [
                              'separator'    => ',',
                              'enclosure'    => chr(34),
                  Severity: Minor
                  Found in src/util/ReadFileData.php - About 2 hrs 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 StrokeCSIM has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function StrokeCSIM($aScriptName = 'auto', $aCSIMName = '', $aBorder = 0)
                      {
                          if ($aCSIMName == '') {
                              // create a random map name
                              srand((int) (microtime() * 1000000));
                  Severity: Minor
                  Found in src/graph/Graph.php - About 2 hrs 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 StrokeWeeks has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function StrokeWeeks($aYCoord, $getHeight = false)
                      {
                          if ($this->week->iShowLabels) {
                              $img = $this->iImg;
                              $yt  = $aYCoord + $img->top_margin;
                  Severity: Minor
                  Found in src/graph/GanttScale.php - About 2 hrs 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 AdjustMarginsForTitles has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function AdjustMarginsForTitles()
                      {
                          $totrequired =
                              ($this->title->t != ''
                              ? $this->title->GetTextHeight($this->img) + $this->title->margin + 5 * SUPERSAMPLING_SCALE
                  Severity: Minor
                  Found in src/graph/Graph.php - About 2 hrs 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 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function Stroke($aFileName = '')
                      {
                          // Find out the necessary size for the container image
                          $w = 0;
                          $h = 0;
                  Severity: Major
                  Found in src/graph/MGraph.php - About 2 hrs to fix

                    GanttGraph has 22 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class GanttGraph extends Graph
                    {
                        public $scale; // Public accessible
                        public $hgrid;
                        private $iObj                    = []; // Gantt objects
                    Severity: Minor
                    Found in src/graph/GanttGraph.php - About 2 hrs to fix

                      Method __construct has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __construct()
                          {
                              /*
                               * File: bullets_balls_red_013.png
                               */
                      Severity: Major
                      Found in src/image/ImgData_Bevels.php - About 2 hrs to fix

                        Method StrokeAxisLabelBackground has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function StrokeAxisLabelBackground()
                            {
                                // Types
                                // 0 = No background
                                // 1 = Only X-labels, length of axis
                        Severity: Major
                        Found in src/graph/Graph.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language