HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Method Stroke has 167 lines of code (exceeds 25 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: Major
Found in src/plot/PiePlot.php - About 6 hrs to fix

    File LinearScale.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Method StrokeGuideLabels has 166 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function StrokeGuideLabels($img, $xc, $yc, $radius)
          {
              $n = safe_count($this->labels);
      
              /**
      Severity: Major
      Found in src/plot/PiePlot.php - About 6 hrs to fix

        Function Stroke has a Cognitive Complexity of 42 (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/RadarGraph.php - About 6 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if (!$this->yscale->IsSpecified() && safe_count($this->plots) > 0) {
                    list($min, $max) = $this->GetPlotsYMinMax($this->plots);
                    $lres            = $this->GetLinesYMinMax($this->lines);
                    if (is_array($lres)) {
                        list($linmin, $linmax) = $lres;
        Severity: Major
        Found in src/graph/Graph.php and 1 other location - About 6 hrs to fix
        src/graph/Graph.php on lines 1400..1442

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 212.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (!$this->y2scale->IsSpecified() && safe_count($this->y2plots) > 0) {
                        list($min, $max) = $this->GetPlotsYMinMax($this->y2plots);
        
                        $lres = $this->GetLinesYMinMax($this->y2lines);
                        if (is_array($lres)) {
        Severity: Major
        Found in src/graph/Graph.php and 1 other location - About 6 hrs to fix
        src/graph/Graph.php on lines 1488..1534

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 212.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    for ($i = 0; $i < $n; ++$i) {
                        $title_xt = $colstarts[$i];
                        $title_xb = $title_xt + $colwidth[$i];
                        $coords   = "${title_xt},${yt},${title_xb},${yt},${title_xb},${yb},${title_xt},${yb}";
        
        
        Severity: Major
        Found in src/plot/MileStone.php and 1 other location - About 6 hrs to fix
        src/plot/GanttBar.php on lines 182..200

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 211.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    for ($i = 0; $i < $n; ++$i) {
                        $title_xt = $colstarts[$i];
                        $title_xb = $title_xt + $colwidth[$i];
                        $coords   = "${title_xt},${yt},${title_xb},${yt},${title_xb},${yb},${title_xt},${yb}";
        
        
        Severity: Major
        Found in src/plot/GanttBar.php and 1 other location - About 6 hrs to fix
        src/plot/MileStone.php on lines 70..88

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 211.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        GanttScale has 46 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class GanttScale
        {
            public $minute;
            public $hour;
            public $day;
        Severity: Minor
        Found in src/graph/GanttScale.php - About 6 hrs to fix

          File PlotMark.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Function LineInterpolate has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                public function LineInterpolate(&$aData)
                {
                    $n = safe_count($aData);
                    $i = 0;
            
            
            Severity: Minor
            Found in src/plot/AccLinePlot.php - About 6 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 Pie3DSlice has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Pie3DSlice($img, $xc, $yc, $w, $h, $sa, $ea, $z, $fillcolor, $shadow = 0.65)
                {
                    // Due to the way the 3D Pie algorithm works we are
                    // guaranteed that any slice we get into this method
                    // belongs to either the left or right side of the
            Severity: Minor
            Found in src/plot/PiePlot3D.php - About 6 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 Pie3DSlice has 155 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function Pie3DSlice($img, $xc, $yc, $w, $h, $sa, $ea, $z, $fillcolor, $shadow = 0.65)
                {
                    // Due to the way the 3D Pie algorithm works we are
                    // guaranteed that any slice we get into this method
                    // belongs to either the left or right side of the
            Severity: Major
            Found in src/plot/PiePlot3D.php - About 6 hrs to fix

              Function getIsobars has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getIsobars()
                  {
                      $this->adjustDataPointValues();
              
                      for ($isobar = 0; $isobar < $this->nbrIsobars; ++$isobar) {
              Severity: Minor
              Found in src/plot/Contour.php - About 6 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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              } elseif ($val < 0) {
                                  $sp[0]  = $pts[4];
                                  $sp[1]  = $pts[5];
                                  $sp[2]  = $pts[6];
                                  $sp[3]  = $pts[7];
              Severity: Major
              Found in src/plot/BarPlot.php and 1 other location - About 6 hrs to fix
              src/plot/BarPlot.php on lines 532..558

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 205.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              if ($val > 0) {
                                  $sp[0]  = $pts[6];
                                  $sp[1]  = $pts[7];
                                  $sp[2]  = $pts[4];
                                  $sp[3]  = $pts[5];
              Severity: Major
              Found in src/plot/BarPlot.php and 1 other location - About 6 hrs to fix
              src/plot/BarPlot.php on lines 545..558

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 205.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function _doLabelFormat has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _doLabelFormat($aVal, $aIdx, $aNbrTicks)
                  {
                      // If precision hasn't been specified set it to a sensible value
                      if ($this->precision == -1) {
                          $t = log10($this->minor_step);
              Severity: Minor
              Found in src/graph/LinearTicks.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 PolarAxis.php has 413 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

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

                    public function Stroke($aImg)
                    {
                        // The way the path for the arrow is constructed is partly based
                        // on some heuristics. This is not an exact science but draws the
                        // path in a way that, for me, makes esthetic sence. For example
                Severity: Minor
                Found in src/image/GanttLink.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 doAutoScaleYnAxis has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function doAutoScaleYnAxis()
                    {
                        if ($this->y2scale != null) {
                            if (!$this->y2scale->IsSpecified() && safe_count($this->y2plots) > 0) {
                                list($min, $max) = $this->GetPlotsYMinMax($this->y2plots);
                Severity: Minor
                Found in src/graph/Graph.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

                Severity
                Category
                Status
                Source
                Language