HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function StrokeLabel has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeLabel($label, $img, $xc, $yc, $a, $r)
    {
        // Default value
        if ($this->ilabelposadj === 'auto') {
            $this->ilabelposadj = 0.65;
Severity: Minor
Found in src/plot/PiePlot.php - About 5 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 Stroke has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function Stroke($aOtherAxisScale, $aStrokeLabels = true)
    {
        if ($this->hide) {
            return;
        }
Severity: Minor
Found in src/graph/Axis.php - About 5 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 _StrokeTTF has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $debug = false)
    {
        // Setup default inter line margin for paragraphs to be
        // 3% of the font height.
        $ConstLineSpacing = 0.03;
Severity: Major
Found in src/image/Image.php - About 5 hrs to fix

    File HandDigits.php has 396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * JPGraph v4.0.3
     */
    Severity: Minor
    Found in src/image/HandDigits.php - About 5 hrs to fix

      File LinePlot.php has 395 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * JPGraph v4.0.3
       */
      Severity: Minor
      Found in src/plot/LinePlot.php - About 5 hrs to fix

        Method StrokeTitles has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function StrokeTitles()
            {
                $margin = 3;
        
                if ($this->titlebackground) {
        Severity: Major
        Found in src/graph/Graph.php - About 5 hrs to fix

          Function StrokeDays has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              public function StrokeDays($aYCoord, $getHeight = false)
              {
                  $img      = $this->iImg;
                  $daywidth = $this->GetDayWidth();
                  $xt       = $img->left_margin + $this->iLabelWidth;
          Severity: Minor
          Found in src/graph/GanttScale.php - About 5 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

          File Legend.php has 389 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * JPGraph v4.0.3
           */
          Severity: Minor
          Found in src/graph/Legend.php - About 5 hrs to fix

            WindrosePlot has 40 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class WindrosePlot
            {
                private $iAntiAlias          = true;
                private $iData               = [];
                public $iX                   = 0.5;
            Severity: Minor
            Found in src/plot/WindrosePlot.php - About 5 hrs to fix

              Method StrokeFrameBackground has 132 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function StrokeFrameBackground()
                  {
                      if ($this->background_image != '' && $this->background_cflag != '') {
                          Util\JpGraphError::RaiseL(25040); //('It is not possible to specify both a background image and a background country flag.');
                      }
              Severity: Major
              Found in src/graph/Graph.php - About 5 hrs to fix

                Function Stroke has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function Stroke($img, $xscale, $yscale)
                    {
                        $n = $this->numpoints;
                        if ($this->center) {
                            --$n;
                Severity: Minor
                Found in src/plot/StockPlot.php - About 5 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 IntAutoScale has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function IntAutoScale($img, $min, $max, $maxsteps, $majend = true)
                    {
                        // Make sure limits are integers
                        $min = floor($min);
                        $max = ceil($max);
                Severity: Minor
                Found in src/graph/LinearScale.php - About 5 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 DoDateAutoScale has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
                    {
                        // Format of array
                        // array ( Decision point,  array( array( Major-scale-step-array ),
                        //       array( Minor-scale-step-array ),
                Severity: Minor
                Found in src/graph/DateScale.php - About 5 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 _StrokeFreeRose has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _StrokeFreeRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
                    {
                        // Plot radial grid lines and remember the end position
                        // and the angle for later use when plotting the labels
                        if ($this->iType != WINDROSE_TYPEFREE) {
                Severity: Major
                Found in src/plot/WindrosePlot.php - About 5 hrs to fix

                  Function Stroke has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function Stroke($aImg, $aX = null, $aY = null)
                      {
                          if ($aX !== null && $aY !== null) {
                              $this->iXPos = $aX;
                              $this->iYPos = $aY;
                  Severity: Minor
                  Found in src/text/GTextTable.php - About 5 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 127 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function Stroke($aImg, $aScale)
                      {
                          $factory = new Graph\RectPatternFactory();
                          $prect   = $factory->Create($this->iPattern, $this->iPatternColor);
                          $prect->SetDensity($this->iPatternDensity);
                  Severity: Major
                  Found in src/plot/GanttBar.php - About 5 hrs to fix

                    Function StrokeHours has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function StrokeHours($aYCoord, $getHeight = false)
                        {
                            $img = $this->iImg;
                            $xt  = $img->left_margin + $this->iLabelWidth;
                            $yt  = $aYCoord + $img->top_margin;
                    Severity: Minor
                    Found in src/graph/GanttScale.php - About 4 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 _StrokeTicks has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _StrokeTicks($aImg, $aScale, $aPos)
                        {
                            $hor = $aScale->type == 'x';
                            $aImg->SetLineWeight($this->weight);
                    
                    
                    Severity: Minor
                    Found in src/graph/LinearTicks.php - About 4 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 __construct has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function Stroke has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function Stroke($aImg, &$grid, $aPos, $aAxisAngle, $aScale, &$aMajPos, &$aMajLabel)
                          {
                              $start     = $aScale->GetMinVal();
                              $limit     = $aScale->GetMaxVal();
                              $nextMajor = 10 * $start;
                      Severity: Minor
                      Found in src/graph/RadarLogTicks.php - About 4 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

                      Severity
                      Category
                      Status
                      Source
                      Language