HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

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

    public function Stroke($img, $aaoption = 0)
    {
        $n = safe_count($this->data);

        // If user hasn't set the colors use the theme array
Severity: Minor
Found in src/plot/PiePlot3D.php - About 3 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 _TransVert3D has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function _TransVert3D($aGdImg, $aHorizon = 100, $aSkewDist = 120, $aDir = SKEW3D_DOWN, $aMinSize = true, $aFillColor = '#FFFFFF', $aQuality = false, $aBorder = false, $aHorizonPos = 0.5)
    {
        // Parameter check
        if ($aHorizonPos < 0 || $aHorizonPos > 1.0) {
            Util\JpGraphError::RaiseL(9001);
Severity: Minor
Found in src/image/ImgTrans.php - About 3 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 Convert has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function Convert($aTxt, $aFF)
    {
        if (LANGUAGE_GREEK) {
            if (GREEK_FROM_WINDOWS) {
                $unistring = LanguageConv::gr_win2uni($aTxt);
Severity: Minor
Found in src/text/LanguageConv.php - About 3 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 StrokeGrid has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeGrid($pos)
    {
        $x = round($this->img->left_margin + $this->img->plotwidth / 2);
        $this->scale->ticks->Stroke($this->img, $this->scale, $pos);

Severity: Minor
Found in src/graph/PolarAxis.php - About 3 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 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    File DateScaleUtils.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * JPGraph v4.0.3
     */
    Severity: Minor
    Found in src/util/DateScaleUtils.php - About 3 hrs to fix

      Method _StrokeLegend has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _StrokeLegend($aImg, $x, $y, $scaling = 1, $aReturnWidth = false)
          {
              if (!$this->legend->iShow) {
                  return 0;
              }
      Severity: Major
      Found in src/plot/WindrosePlot.php - About 3 hrs to fix

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

            public function Stroke($aImg, $aX = null, $aY = null)
            {
                if ($aX !== null && $aY !== null) {
                    $this->iXPos = $aX;
                    $this->iYPos = $aY;
        Severity: Major
        Found in src/text/GTextTable.php - About 3 hrs to fix

          Method IndentedRectangle has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function IndentedRectangle($xt, $yt, $w, $h, $iw = 0, $ih = 0, $aCorner = 3, $aFillColor = '', $r = 4)
              {
                  list($xt, $yt) = $this->scale->Translate($xt, $yt);
                  list($w, $h)   = $this->scale->Translate($w, $h);
                  list($iw, $ih) = $this->scale->Translate($iw, $ih);
          Severity: Major
          Found in src/graph/Shape.php - About 3 hrs to fix

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

                public function Stroke($img, $xscale, $yscale)
                {
                    $ymin = $yscale->scale_abs[0];
                    if ($yscale->scale[0] < 0) {
                        $yzero = $yscale->Translate(0);
            Severity: Minor
            Found in src/plot/ScatterPlot.php - About 3 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 Legend has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Legend($graph)
                {
                    $colors = array_keys($graph->img->rgb->rgb_table);
                    sort($colors);
                    $ta = $this->themearr[$this->theme];
            Severity: Minor
            Found in src/plot/PiePlot.php - About 3 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 _StrokeBuiltinFont has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _StrokeBuiltinFont($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $aDebug = false)
                {
                    if (is_numeric($dir) && $dir != 90 && $dir != 0) {
                        Util\JpGraphError::RaiseL(25091);
                    }
            Severity: Minor
            Found in src/image/Image.php - About 3 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 imageSmoothArc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, $start, $stop)
                {
                    // Originally written from scratch by Ulrich Mierendorff, 06/2006
                    // Rewritten and improved, 04/2007, 07/2007
                    // compared to old version:
            Severity: Minor
            Found in src/image/Image.php - About 3 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 Get has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Get($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
                {
                    global $__jpg_err_locale;
                    if (!isset($this->lt[$errnbr])) {
                        return 'Internal error: The specified error message (' . $errnbr . ') does not exist in the chosen locale (' . $__jpg_err_locale . ')';
            Severity: Minor
            Found in src/util/ErrMsgText.php - About 3 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 GetWidth has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function GetWidth($aImg, $aUseTabs = false, $aTabExtraMargin = 1.1)
                {
                    $extra_margin = 4;
                    $aImg->SetFont($this->iFFamily, $this->iFStyle, $this->iFSize);
                    if (is_string($this->iText)) {
            Severity: Minor
            Found in src/text/TextProperty.php - About 3 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 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Stroke($aImg, &$grid, $aPos, $aAxisAngle, $aScale, &$aMajPos, &$aMajLabel)
                {
                    // Prepare to draw linear ticks
                    $maj_step_abs = abs($aScale->scale_factor * $this->major_step);
                    $min_step_abs = abs($aScale->scale_factor * $this->minor_step);
            Severity: Minor
            Found in src/graph/RadarLinearTicks.php - About 3 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 StrokeBoxedText has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function StrokeBoxedText(
                    $x,
                    $y,
                    $txt,
                    $dir = 0,
            Severity: Major
            Found in src/image/Image.php - About 3 hrs to fix

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

                  public function Stroke($aOtherAxisScale, $aStrokeLabels = true)
                  {
                      if ($this->hide) {
                          return;
                      }
              Severity: Major
              Found in src/graph/Axis.php - About 3 hrs to fix

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

                    public function Stroke($img, $xscale, $yscale)
                    {
                        $n = $this->numpoints;
                        if ($this->center) {
                            --$n;
                Severity: Major
                Found in src/plot/StockPlot.php - About 3 hrs to fix

                  Function Color has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function Color($aColor)
                      {
                          if (is_string($aColor)) {
                              $matches = [];
                              // this regex will parse a color string and fill the $matches array as such:
                  Severity: Minor
                  Found in src/image/RGB.php - About 3 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