HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

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

        The class Shape has 14 public methods. Consider refactoring Shape to keep number of public methods under 10.
        Open

        class Shape
        {
            private $img;
            private $scale;
        
        
        Severity: Minor
        Found in src/graph/Shape.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class RadarGraph has an overall complexity of 69 which is very high. The configured complexity threshold is 50.
        Open

        class RadarGraph extends Graph
        {
            public $grid;
            public $axis;
            private $posx;
        Severity: Minor
        Found in src/graph/RadarGraph.php by phpmd

        The class Image has 56 public methods. Consider refactoring Image to keep number of public methods under 10.
        Open

        class Image
        {
            public $img;
            public $rgb;
            public $img_format;
        Severity: Minor
        Found in src/image/Image.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class Image has an overall complexity of 400 which is very high. The configured complexity threshold is 50.
        Open

        class Image
        {
            public $img;
            public $rgb;
            public $img_format;
        Severity: Minor
        Found in src/image/Image.php by phpmd

        The class Image has 57 non-getter- and setter-methods. Consider refactoring Image to keep number of methods under 25.
        Open

        class Image
        {
            public $img;
            public $rgb;
            public $img_format;
        Severity: Minor
        Found in src/image/Image.php by phpmd

        TooManyMethods

        Since: 0.1

        A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        The default was changed from 10 to 25 in PHPMD 2.3.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanymethods

        The class RotImage has 17 public methods. Consider refactoring RotImage to keep number of public methods under 10.
        Open

        class RotImage extends Image
        {
            public $a      = 0;
            public $dx     = 0;
            public $dy     = 0;
        Severity: Minor
        Found in src/image/RotImage.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class AccBarPlot has an overall complexity of 73 which is very high. The configured complexity threshold is 50.
        Open

        class AccBarPlot extends BarPlot
        {
            public $plots;
            private $nbrplots = 0;
        
        
        Severity: Minor
        Found in src/plot/AccBarPlot.php by phpmd

        The class Axis has an overall complexity of 60 which is very high. The configured complexity threshold is 50.
        Open

        class Axis extends AxisPrototype
        {
            public function __construct($img, $aScale, $color = 'black')
            {
                parent::__construct($img, $aScale, $color);
        Severity: Minor
        Found in src/graph/Axis.php by phpmd

        The class DateScale has an overall complexity of 70 which is very high. The configured complexity threshold is 50.
        Open

        class DateScale extends LinearScale
        {
            private $date_format     = '';
            private $iStartAlign     = false;
            private $iEndAlign       = false;
        Severity: Minor
        Found in src/graph/DateScale.php by phpmd

        The class GanttScale has an overall complexity of 179 which is very high. The configured complexity threshold is 50.
        Open

        class GanttScale
        {
            public $minute;
            public $hour;
            public $day;
        Severity: Minor
        Found in src/graph/GanttScale.php by phpmd
        Severity
        Category
        Status
        Source
        Language