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;
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);
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);
- Read upRead up
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];
- Read upRead up
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);
}
- Read upRead up
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:
- Read upRead up
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 . ')';
- Read upRead up
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)) {
- Read upRead up
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);
- Read upRead up
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,
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;
- Read upRead up
- Exclude checks
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;
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Exclude checks
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);
- Exclude checks
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;
- Exclude checks
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;
- Exclude checks