HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method FilledRectangle has 247 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
    {
        $this->img->SetLineWeight(1);
        switch ($style) {
            case GRAD_VER:
Severity: Major
Found in src/plot/Gradient.php - About 1 day to fix

    File RGB.php has 555 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * JPGraph v4.0.3
     */
    Severity: Major
    Found in src/image/RGB.php - About 1 day to fix

      File RGB.php has 551 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * JPGraph v4.0.3
       */
      Severity: Major
      Found in src/util/RGB.php - About 1 day to fix

        Method _imageSmoothArcDrawSegment has 227 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function _imageSmoothArcDrawSegment(&$img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $seg)
            {
                $fillColor = imagecolorexactalpha($img, $color[0], $color[1], $color[2], $color[3]);
        
                $xStart  = abs($a * cos($start));
        Severity: Major
        Found in src/image/Image.php - About 1 day to fix

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

              public function __construct()
              {
                  /*
                   * warning.png
                   */
          Severity: Major
          Found in src/image/PredefIcons.php - About 1 day to fix

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

                public function Stroke($img, $xscale, $yscale)
                {
                    $idx       = 0;
                    $numpoints = safe_count($this->coords[0]);
                    if (isset($this->coords[1])) {
            Severity: Major
            Found in src/plot/LinePlot.php - About 1 day to fix

              Function StrokeConstrains has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function StrokeConstrains()
                  {
                      $n = safe_count($this->iObj);
              
                      // Stroke all constrains
              Severity: Minor
              Found in src/graph/GanttGraph.php - About 1 day 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 222 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function Stroke($aImg)
                  {
                      // Constant
                      $fillBoxFrameWeight = 1;
              
              
              Severity: Major
              Found in src/graph/Legend.php - About 1 day to fix

                GTextTable has 60 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class GTextTable
                {
                    public $iCells   = [];
                    public $iSize    = [0, 0]; // Need to be public since they are used by the cell
                    private $iWidth  = 0;
                Severity: Major
                Found in src/text/GTextTable.php - About 1 day to fix

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

                      public function Stroke($aStrokeFileName = '')
                      {
                          // If the filename is the predefined value = '_csim_special_'
                          // we assume that the call to stroke only needs to do enough
                          // to correctly generate the CSIM maps.
                  Severity: Minor
                  Found in src/graph/PieGraph.php - About 1 day 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 197 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function __construct()
                      {
                          self::$FONT_BASEPATH = getenv('JPGRAPH_FONT_BASEPATH') ?
                          getenv('JPGRAPH_FONT_BASEPATH') :
                          dirname(__DIR__) . '/fonts/';
                  Severity: Major
                  Found in src/text/TTF.php - About 7 hrs to fix

                    Function Stroke has a Cognitive Complexity of 50 (exceeds 5 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: Minor
                    Found in src/plot/GanttBar.php - About 7 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 49 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function Stroke($aImg, $aX, $aY)
                        {
                            if ($this->iShow) {
                                $aImg->SetColor($this->iColor);
                                $aImg->SetFont($this->iFFamily, $this->iFStyle, $this->iFSize);
                    Severity: Minor
                    Found in src/text/TextProperty.php - About 7 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 StrokeTitles has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function StrokeTitles()
                        {
                            $margin = 3;
                    
                            if ($this->titlebackground) {
                    Severity: Minor
                    Found in src/graph/Graph.php - About 7 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 AutoSize has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function AutoSize()
                        {
                            if ($this->img->img == null) {
                                // The predefined left, right, top, bottom margins.
                                // Note that the top margin might incease depending on
                    Severity: Major
                    Found in src/graph/GanttGraph.php - About 7 hrs to fix

                      Function FilledRectangle has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
                          {
                              $this->img->SetLineWeight(1);
                              switch ($style) {
                                  case GRAD_VER:
                      Severity: Minor
                      Found in src/plot/Gradient.php - About 7 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 _StrokeTTF has a Cognitive Complexity of 48 (exceeds 5 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: Minor
                      Found in src/image/Image.php - About 7 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 GTextTableCell.php has 474 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       * JPGraph v4.0.3
                       */
                      Severity: Minor
                      Found in src/text/GTextTableCell.php - About 7 hrs to fix

                        File ImgData_PushPins.php has 463 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

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

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

                              public function Stroke($aStrokeFileName = '')
                              {
                                  // Fist make a sanity check that user has specified a scale
                                  if (empty($this->yscale)) {
                                      Util\JpGraphError::RaiseL(25031); //('You must specify what scale to use with a call to Graph::SetScale().');
                          Severity: Major
                          Found in src/graph/Graph.php - About 7 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language