HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function Create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function Create($aPattern, $aColor, $aWeight = 1)
    {
        switch ($aPattern) {
            case BAND_RDIAG:
                $obj = new RectPatternRDiag($aColor, $aWeight);
Severity: Minor
Found in src/graph/RectPatternFactory.php - About 55 mins 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 AddY2 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function AddY2($aPlot)
    {
        if ($aPlot == null) {
            Util\JpGraphError::RaiseL(25011); //("Graph::AddY2() You tried to add a null plot to the graph.");
        }
Severity: Minor
Found in src/graph/Graph.php - About 55 mins 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 DoPattern has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function DoPattern($aImg)
    {
        //  --------------------
        //  | /   /   /   /   /|
        //  |/   /   /   /   / |
Severity: Minor
Found in src/graph/RectPatternRDiag.php - About 55 mins 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 _fileCheck has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function _fileCheck($filename, &$ownFixtures = [], $debug = false)
    {
        if (\is_array($filename)) {
            if (\array_key_exists('width', $filename)) {
                $__width = $filename['width'];
Severity: Minor
Found in tests/UnitTestTrait.php - About 55 mins 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 ModBox has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function ModBox($img, $xscale, $yscale, $i, $xl, $xr, $neg)
Severity: Major
Found in src/plot/BoxPlot.php - About 50 mins to fix

    Method _Stroke has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function _Stroke($aImg, $aMinX, $aMinY, $aMaxX, $aMaxY, $aXPos, $aYPos)
    Severity: Major
    Found in src/plot/PlotLine.php - About 50 mins to fix

      Method FilledRectangle has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function FilledRectangle($xl, $yt, $xr, $yb, $from_color, $to_color, $style = 1)
      Severity: Major
      Found in src/plot/Gradient.php - About 50 mins to fix

        Method _StrokeRegularRose has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function _StrokeRegularRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
        Severity: Major
        Found in src/plot/WindrosePlot.php - About 50 mins to fix

          Method _StrokeFreeRose has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function _StrokeFreeRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri)
          Severity: Major
          Found in src/plot/WindrosePlot.php - About 50 mins to fix

            Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct($aDir, $aPattern, $aMin, $aMax, $aColor = 'black', $aWeight = 1, $aDepth = DEPTH_BACK)
            Severity: Major
            Found in src/plot/PlotBand.php - About 50 mins to fix

              Method ModBox has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function ModBox($img, $xscale, $yscale, $i, $xl, $xr, $neg)
              Severity: Major
              Found in src/plot/StockPlot.php - About 50 mins to fix

                Method Bevel has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function Bevel($x1, $y1, $x2, $y2, $depth = 2, $color1 = 'white@0.4', $color2 = 'black@0.5')
                Severity: Major
                Found in src/image/Image.php - About 50 mins to fix

                  Method FilledRectangle2 has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function FilledRectangle2($xl, $yu, $xr, $yl, $color1, $color2, $style = 1)
                  Severity: Major
                  Found in src/image/Image.php - About 50 mins to fix

                    Method Skew3D has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function Skew3D($aHorizon = 120, $aSkewDist = 150, $aDir = SKEW3D_DOWN, $aHiQuality = false, $aMinSize = true, $aFillColor = '#FFFFFF', $aBorder = false)
                    Severity: Major
                    Found in src/image/ImgTrans.php - About 50 mins to fix

                      Method FilledArc has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function FilledArc($xc, $yc, $w, $h, $s, $e, $style = '')
                      Severity: Major
                      Found in src/image/RotImage.php - About 50 mins to fix

                        Method FilledBevel has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function FilledBevel($x1, $y1, $x2, $y2, $depth = 2, $color1 = 'white@0.4', $color2 = 'darkgray@0.4')
                        Severity: Major
                        Found in src/image/Image.php - About 50 mins to fix

                          Method FilledArc has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function FilledArc($xc, $yc, $w, $h, $s, $e, $style = '')
                          Severity: Major
                          Found in src/image/Image.php - About 50 mins to fix

                            Method _StrokeTTF has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $debug = false)
                            Severity: Major
                            Found in src/image/Image.php - About 50 mins to fix

                              Method DrawLine has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color)
                              Severity: Major
                              Found in src/image/Image.php - About 50 mins to fix

                                Method _StrokeBuiltinFont has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public function _StrokeBuiltinFont($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $aDebug = false)
                                Severity: Major
                                Found in src/image/Image.php - About 50 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language