HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Graph has 92 functions (exceeds 20 allowed). Consider refactoring.
Open

class Graph
{
    public $gDateLocale;
    public $gJpgDateLocale;
    public $cache; // Cache object (singleton)
Severity: Major
Found in src/graph/Graph.php - About 1 day to fix

    File PiePlot3D.php has 745 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Image has 85 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Image
      {
          public $img;
          public $rgb;
          public $img_format;
      Severity: Major
      Found in src/image/Image.php - About 1 day to fix

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

            public function Stroke($aImg)
            {
                // Constant
                $fillBoxFrameWeight = 1;
        
        
        Severity: Minor
        Found in src/graph/Legend.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

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

            public function Stroke($img, $aaoption = 0)
            {
                // aaoption is used to handle antialias
                // aaoption == 0 a normal pie
                // aaoption == 1 just the body
        Severity: Minor
        Found in src/plot/PiePlot.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

        Function AutoSize has a Cognitive Complexity of 77 (exceeds 5 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: 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

        Function StrokeAngleLabels has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
        Open

            public function StrokeAngleLabels($pos, $type)
            {
                if (!$this->show_angle_label) {
                    return;
                }
        Severity: Minor
        Found in src/graph/PolarAxis.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 306 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

              public function Stroke($img, $scale, $pos)
              {
                  $start     = $scale->GetMinVal();
                  $limit     = $scale->GetMaxVal();
                  $nextMajor = 10 * $start;
          Severity: Minor
          Found in src/graph/LogTicks.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

          File GanttGraph.php has 649 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

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

                public function Stroke($img, $x, $y)
                {
                    if (!$this->show) {
                        return;
                    }
            Severity: Minor
            Found in src/plot/PlotMark.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

            Function _StrokeRegularRose has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _StrokeRegularRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
                {
                    // _StrokeRegularRose($dblImg,$xc,$yc,$r,$ri)
                    // Plot radial grid lines and remember the end position
                    // and the angle for later use when plotting the labels
            Severity: Minor
            Found in src/plot/WindrosePlot.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 262 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function Stroke($img, $x, $y)
                {
                    if (!$this->show) {
                        return;
                    }
            Severity: Major
            Found in src/plot/PlotMark.php - About 1 day to fix

              File BarPlot.php has 595 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                Function _StrokeFreeRose has a Cognitive Complexity of 65 (exceeds 5 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: Minor
                Found in src/plot/WindrosePlot.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

                Function Stroke has a Cognitive Complexity of 65 (exceeds 5 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: Minor
                Found in src/graph/Graph.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 Pie3D has 250 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function Pie3D(
                        $aaoption,
                        $img,
                        $data,
                        $colors,
                Severity: Major
                Found in src/plot/PiePlot3D.php - About 1 day to fix

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

                      public function Stroke($img, $xscale, $yscale)
                      {
                          $pattern = null;
                          $img->SetLineWeight($this->weight);
                          $grad = null;
                  Severity: Major
                  Found in src/plot/AccBarPlot.php - About 1 day to fix

                    Function SetAutoScaleAngle has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function SetAutoScaleAngle($aIsRegRose = true)
                        {
                            // If the user already has manually set an angle don't
                            // trye to find a position
                            if (is_numeric($this->scale->iAngle)) {
                    Severity: Minor
                    Found in src/plot/WindrosePlot.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

                    Function doAutoscaleXAxis has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function doAutoscaleXAxis()
                        {
                            $aPlots = array_filter($this->plots, function ($plot) {
                                //\Kint::dump($plot, $plot instanceof Plot\Plot);
                                return $plot instanceof Plot\Plot;
                    Severity: Minor
                    Found in src/graph/Graph.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

                    Severity
                    Category
                    Status
                    Source
                    Language