File GTextTable.php
has 771 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* JPGraph v4.0.3
*/
GTextTable
has 60 functions (exceeds 20 allowed). Consider refactoring. Open
class GTextTable
{
public $iCells = [];
public $iSize = [0, 0]; // Need to be public since they are used by the cell
private $iWidth = 0;
Function Stroke
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($aImg, $aX = null, $aY = null)
{
if ($aX !== null && $aY !== null) {
$this->iXPos = $aX;
$this->iYPos = $aY;
- 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 Set
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function Set($aArg1, $aArg2 = null, $aArg3 = null)
{
if ($aArg2 === null && $aArg3 === null) {
if (is_array($aArg1)) {
if (is_array($aArg1[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
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;
The class GTextTable has 13 public methods. Consider refactoring GTextTable to keep number of public methods under 10. Open
class GTextTable
{
public $iCells = [];
public $iSize = [0, 0]; // Need to be public since they are used by the cell
private $iWidth = 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 GTextTable has an overall complexity of 212 which is very high. The configured complexity threshold is 50. Open
class GTextTable
{
public $iCells = [];
public $iSize = [0, 0]; // Need to be public since they are used by the cell
private $iWidth = 0;
- Exclude checks
Function MergeCells
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function MergeCells($aR1, $aC1, $aR2, $aC2, $aHAlign = 'center', $aVAlign = 'center')
{
if ($aR1 > $aR2 || $aC1 > $aC2) {
Util\JpGraphError::RaiseL(27004);
//('GTextTable::MergeCells(). Specified cell range to be merged is not valid.');
- 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 SetFont
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function SetFont()
{
$numargs = func_num_args();
if ($numargs == 2 || $numargs == 3) {
$aFF = func_get_arg(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
The class GTextTable has 17 fields. Consider redesigning GTextTable to keep the number of fields under 15. Open
class GTextTable
{
public $iCells = [];
public $iSize = [0, 0]; // Need to be public since they are used by the cell
private $iWidth = 0;
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Method SetFont
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function SetFont()
{
$numargs = func_num_args();
if ($numargs == 2 || $numargs == 3) {
$aFF = func_get_arg(0);
Function _autoSizeTable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function _autoSizeTable($aImg)
{
// Get maximum column width and row height
$m = $this->iSize[0];
$n = $this->iSize[1];
- 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 Set
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Set($aArg1, $aArg2 = null, $aArg3 = null)
{
if ($aArg2 === null && $aArg3 === null) {
if (is_array($aArg1)) {
if (is_array($aArg1[0])) {
The class GTextTable has 62 public methods and attributes. Consider reducing the number of public items to less than 45. Open
class GTextTable
{
public $iCells = [];
public $iSize = [0, 0]; // Need to be public since they are used by the cell
private $iWidth = 0;
- Read upRead up
- Exclude checks
ExcessivePublicCount
Since: 0.1
A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
Example
public class Foo {
public $value;
public $something;
public $var;
// [... more more public attributes ...]
public function doWork() {}
public function doMoreWork() {}
public function doWorkAgain() {}
// [... more more public methods ...]
}
Source https://phpmd.org/rules/codesize.html#excessivepubliccount
Function SetImage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function SetImage($aFileR1, $aScaleC1 = null, $aMixR2 = null, $aC2 = null, $aFile = null, $aScale = 1.0, $aMix = 100)
{
if ($aScaleC1 !== null && $aMixR2 !== null && $aC2 !== null && $aFile !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
- 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 SetAlign
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
{
if ($aC1VAlign !== null && $aR2 !== null && $aC2 !== null && $aHArg !== null) {
$this->_chkR($aR1HAlign);
$this->_chkC($aC1VAlign);
- 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 _autoSizeTable
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _autoSizeTable($aImg)
{
// Get maximum column width and row height
$m = $this->iSize[0];
$n = $this->iSize[1];
Method SetImage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetImage($aFileR1, $aScaleC1 = null, $aMixR2 = null, $aC2 = null, $aFile = null, $aScale = 1.0, $aMix = 100)
Function SetFillColor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function SetFillColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
{
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
- 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 SetAlign
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
Method SetCellCountryFlag
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetCellCountryFlag($aRow, $aCol, $aFlag, $aScale = 1.0, $aMix = 100, $aStdSize = 3)
Method MergeCells
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function MergeCells($aR1, $aC1, $aR2, $aC2, $aHAlign = 'center', $aVAlign = 'center')
Method SetPadding
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetPadding($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aPad = null)
Method SetCellFont
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetCellFont($aRow, $aCol, $aFF, $aFS, $aFSize = 10)
Method SetNumberFormat
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetNumberFormat($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
Method SetFillColor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetFillColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
Method SetCellImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetCellImage($aRow, $aCol, $aFile, $aScale = 1.0, $aMix = 100)
Method SetTextOrientation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetTextOrientation($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aO = null)
Method SetColor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
Function SetCSIMTarget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function SetCSIMTarget($aTarget, $aAlt = null, $aAutoTarget = false)
{
$m = $this->iSize[0];
$n = $this->iSize[1];
$csim = '';
- 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 SetNumberFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function SetNumberFormat($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
{
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
- 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 SetPadding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function SetPadding($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aPad = null)
{
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
- 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 SetTextOrientation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function SetTextOrientation($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aO = null)
{
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
- 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 toString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function toString()
{
$t = '<table border=1 cellspacing=0 cellpadding=0>';
for ($i = 0; $i < $this->iSize[0]; ++$i) {
$t .= '<tr>';
- 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 SetColor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function SetColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
{
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
- 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
The method Stroke() has an NPath complexity of 559872. The configured NPath complexity threshold is 200. Open
public function Stroke($aImg, $aX = null, $aY = null)
{
if ($aX !== null && $aY !== null) {
$this->iXPos = $aX;
$this->iYPos = $aY;
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method Stroke() has 118 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function Stroke($aImg, $aX = null, $aY = null)
{
if ($aX !== null && $aY !== null) {
$this->iXPos = $aX;
$this->iYPos = $aY;
- Exclude checks
The class GTextTable has 1039 lines of code. Current threshold is 1000. Avoid really long classes. Open
class GTextTable
{
public $iCells = [];
public $iSize = [0, 0]; // Need to be public since they are used by the cell
private $iWidth = 0;
- Exclude checks
The method Stroke() has a Cyclomatic Complexity of 27. The configured cyclomatic complexity threshold is 10. Open
public function Stroke($aImg, $aX = null, $aY = null)
{
if ($aX !== null && $aY !== null) {
$this->iXPos = $aX;
$this->iYPos = $aY;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method SetAlign() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
{
if ($aC1VAlign !== null && $aR2 !== null && $aC2 !== null && $aHArg !== null) {
$this->_chkR($aR1HAlign);
$this->_chkC($aC1VAlign);
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid using undefined variables such as '$aArgR1' which will lead to PHP notices. Open
$this->_chkR($aArgR1);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aC1' which will lead to PHP notices. Open
for ($j = $aC1; $j <= $aC2; ++$j) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aC1' which will lead to PHP notices. Open
$this->_chkC($aC1);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aArgR1' which will lead to PHP notices. Open
for ($i = $aArgR1; $i <= $aR2; ++$i) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aPad' which will lead to PHP notices. Open
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aR2' which will lead to PHP notices. Open
for ($i = $aArgR1; $i <= $aR2; ++$i) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aR2' which will lead to PHP notices. Open
$this->_chkR($aR2);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The method SetCSIMTarget has a boolean flag argument $aAutoTarget, which is a certain sign of a Single Responsibility Principle violation. Open
public function SetCSIMTarget($aTarget, $aAlt = null, $aAutoTarget = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method SetFont uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aFSize = 10;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'SetAlign'. Open
Util\JpGraphError::RaiseL(27010);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'MergeCells'. Open
Util\JpGraphError::RaiseL(27005, $aR1, $aC1, $aR2, $aC2);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method '_chkC'. Open
Util\JpGraphError::RaiseL(27006, $aCol);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method '_chkR'. Open
Util\JpGraphError::RaiseL(27007, $aRow);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
for ($i = 0; $i < $this->iBorderWeight; ++$i) {
$aImg->Rectangle(
$this->iXPos + $i,
$this->iYPos + $i,
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method SetPadding uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aPad = $aArgR1;
$aR2 = $this->iSize[0] - 1;
$aArgR1 = 0;
$aC2 = $this->iSize[1] - 1;
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method SetFont uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
Util\JpGraphError::RaiseL(27003);
//('Wrong number of arguments to GTextTable::SetColor()');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'SetNumberFormat'. Open
Util\JpGraphError::RaiseL(27013); // argument must be a string
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method Set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Must be in the form (row,col,val)
$this->_chkR($aArg1);
$this->_chkC($aArg2);
$this->_setcell($aArg1, $aArg2, (string) $aArg3);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'MergeCells'. Open
Util\JpGraphError::RaiseL(27004);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method Set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
Util\JpGraphError::RaiseL(27002);
//('Illegal argument to GTextTable::Set()');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method SetFillColor uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->iBGColor = $aArgR1;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'Stroke'. Open
Util\JpGraphError::RaiseL(27009);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method Set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->_setcell($i, $j);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'SetColNumberFormat'. Open
Util\JpGraphError::RaiseL(27013); // argument must be a string
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method _autoSizeTable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->iColWidth[$j] = $w;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method _setcell uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->iCells[$aRow][$aCol] = new GTextTableCell((string) $aVal, $aRow, $aCol);
$this->iCells[$aRow][$aCol]->Init($this);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method SetColor uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aArg = $aArgR1;
$aR2 = $this->iSize[0] - 1;
$aArgR1 = 0;
$aC2 = $this->iSize[1] - 1;
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'SetFont'. Open
Util\JpGraphError::RaiseL(27003);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetMinColWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->_chkC($aColWidth);
$this->iColWidth[$aColWidth] = $aWidth;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'MergeCells'. Open
Util\JpGraphError::RaiseL(27005, $aR1, $aC1, $aR2, $aC2);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'Stroke'. Open
Util\JpGraphError::RaiseL(27008);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetTextOrientation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aO = $aArgR1;
$aR2 = $this->iSize[0] - 1;
$aArgR1 = 0;
$aC2 = $this->iSize[1] - 1;
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'SetCellNumberFormat'. Open
Util\JpGraphError::RaiseL(27013); // argument must be a string
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'Set'. Open
Util\JpGraphError::RaiseL(27001);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetAlign uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ($aR1HAlign === null) {
Util\JpGraphError::RaiseL(27010);
}
if ($aC1VAlign === null) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method StrokeWithScale uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->Stroke($aImg);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'SetRowNumberFormat'. Open
Util\JpGraphError::RaiseL(27013); // argument must be a string
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetCSIMTarget uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$t = $aTarget;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method '_chkR'. Open
Util\JpGraphError::Raise(27014); // Table not initialized
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetFont uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aFSize = 10;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method Set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
Util\JpGraphError::RaiseL(27001);
//('Illegal argument to GTextTable::Set(). Array must be 2 dimensional');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method 'Set'. Open
Util\JpGraphError::RaiseL(27002);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetNumberFormat uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aArg = $aArgR1;
$aR2 = $this->iSize[0] - 1;
$aArgR1 = 0;
$aC2 = $this->iSize[1] - 1;
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method SetMinRowHeight uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->_chkR($aRowHeight);
$this->iRowHeight[$aRowHeight] = $aHeight;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method '_chkC'. Open
Util\JpGraphError::Raise(27014); // Table not initialized
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method SetImage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ($aScaleC1 !== null) {
$aScale = $aScaleC1;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method _autoSizeTable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->iRowHeight[$i] = $h;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused private fields such as '$iWidth'. Open
private $iWidth = 0;
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused local variables such as '$aPad'. Open
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused private fields such as '$iHeight'. Open
private $iHeight = 0;
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused private fields such as '$iImg'. Open
private $iImg;
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused local variables such as '$csim'. Open
$csim = '';
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Similar blocks of code found in 4 locations. Consider refactoring. Open
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
$this->_chkR($aR2);
$this->_chkC($aC2);
- Read upRead up
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 139.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
$this->_chkR($aR2);
$this->_chkC($aC2);
- Read upRead up
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 139.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
$this->_chkR($aR2);
$this->_chkC($aC2);
- Read upRead up
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 139.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
$this->_chkR($aArgR1);
$this->_chkC($aC1);
$this->_chkR($aR2);
$this->_chkC($aC2);
- Read upRead up
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 139.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for ($i = 0; $i < $m; ++$i) {
$h = 0;
for ($j = 0; $j < $n; ++$j) {
$h = max($h, $this->iCells[$i][$j]->GetHeight($aImg));
}
- Read upRead up
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 134.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for ($j = 0; $j < $n; ++$j) {
$w = 0;
for ($i = 0; $i < $m; ++$i) {
$w = max($w, $this->iCells[$i][$j]->GetWidth($aImg));
}
- Read upRead up
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 134.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function SetMinRowHeight($aRowHeight, $aHeight = null)
{
// If there is only one argument this means that all
// rows get set to the same height
if ($aHeight === null) {
- Read upRead up
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 91.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function SetMinColWidth($aColWidth, $aWidth = null)
{
// If there is only one argument this means that all
// columns get set to the same width
if ($aWidth === null) {
- Read upRead up
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 91.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid variables with short names like $rc. Configured minimum length is 3. Open
$rc = $this->iSize[0];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $m. Configured minimum length is 3. Open
$m = safe_count($aArg1);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $m. Configured minimum length is 3. Open
$m = $this->iSize[0];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $n. Configured minimum length is 3. Open
$n = $this->iSize[1];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aX. Configured minimum length is 3. Open
public function Stroke($aImg, $aX = null, $aY = null)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $t. Configured minimum length is 3. Open
$t = $aTarget . "?row=${i}&col=${j}";
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $rc. Configured minimum length is 3. Open
$rc = $this->iSize[0]; // row count
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aX. Configured minimum length is 3. Open
public function SetPos($aX, $aY)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $m. Configured minimum length is 3. Open
$m = $this->iSize[0];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $h. Configured minimum length is 3. Open
$h = 1;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $x. Configured minimum length is 3. Open
$x = round($aXScale->Translate($this->iScaleXPos));
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aF. Configured minimum length is 3. Open
public function SetColNumberFormat($aCol, $aF)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $w. Configured minimum length is 3. Open
$w = 1;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $n. Configured minimum length is 3. Open
$n = $this->iSize[1];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aY. Configured minimum length is 3. Open
public function SetScalePos($aX, $aY)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aF. Configured minimum length is 3. Open
public function SetRowNumberFormat($aRow, $aF)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $m. Configured minimum length is 3. Open
$m = $this->iSize[0];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aY. Configured minimum length is 3. Open
public function Stroke($aImg, $aX = null, $aY = null)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $cc. Configured minimum length is 3. Open
$cc = $this->iSize[1]; // column count
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aX. Configured minimum length is 3. Open
public function SetScalePos($aX, $aY)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $y. Configured minimum length is 3. Open
$y = round($aYScale->Translate($this->iScaleYPos));
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $t. Configured minimum length is 3. Open
$t = '<table border=1 cellspacing=0 cellpadding=0>';
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aO. Configured minimum length is 3. Open
public function SetTextOrientation($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aO = null)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $cc. Configured minimum length is 3. Open
$cc = $this->iSize[1];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $n. Configured minimum length is 3. Open
$n = $this->iSize[1];
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aY. Configured minimum length is 3. Open
public function SetPos($aX, $aY)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $n. Configured minimum length is 3. Open
$n = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aO. Configured minimum length is 3. Open
public function SetColTextOrientation($aCol, $aO)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aO. Configured minimum length is 3. Open
public function SetRowTextOrientation($aRow, $aO)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aO. Configured minimum length is 3. Open
public function SetCellTextOrientation($aRow, $aCol, $aO)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $aF. Configured minimum length is 3. Open
public function SetCellNumberFormat($aRow, $aCol, $aF)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Method name "GTextTable::SetScalePos" is not in camel caps format Open
public function SetScalePos($aX, $aY)
- Exclude checks
Method name "GTextTable::SetCellImageConstrain" is not in camel caps format Open
public function SetCellImageConstrain($aRow, $aCol, $aType, $aVal)
- Exclude checks
Method name "GTextTable::SetRowAlign" is not in camel caps format Open
public function SetRowAlign($aRow, $aHorAlign, $aVertAlign = 'bottom')
- Exclude checks
Method name "GTextTable::Stroke" is not in camel caps format Open
public function Stroke($aImg, $aX = null, $aY = null)
- Exclude checks
Method name "GTextTable::SetColFillColor" is not in camel caps format Open
public function SetColFillColor($aCol, $aColor)
- Exclude checks
Method name "GTextTable::SetAlign" is not in camel caps format Open
public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
- Exclude checks
Method name "GTextTable::SetCellImage" is not in camel caps format Open
public function SetCellImage($aRow, $aCol, $aFile, $aScale = 1.0, $aMix = 100)
- Exclude checks
Method name "GTextTable::SetCellPadding" is not in camel caps format Open
public function SetCellPadding($aRow, $aCol, $aPad)
- Exclude checks
Method name "GTextTable::SetRowColor" is not in camel caps format Open
public function SetRowColor($aRow, $aColor)
- Exclude checks
Method name "GTextTable::SetColFont" is not in camel caps format Open
public function SetColFont($aCol, $aFF, $aFS, $aFSize = 10)
- Exclude checks
Method name "GTextTable::SetCellNumberFormat" is not in camel caps format Open
public function SetCellNumberFormat($aRow, $aCol, $aF)
- Exclude checks
Method name "GTextTable::SetPos" is not in camel caps format Open
public function SetPos($aX, $aY)
- Exclude checks
Method name "GTextTable::SetRowFillColor" is not in camel caps format Open
public function SetRowFillColor($aRow, $aColor)
- Exclude checks
Method name "GTextTable::SetRowFont" is not in camel caps format Open
public function SetRowFont($aRow, $aFF, $aFS, $aFSize = 10)
- Exclude checks
Method name "GTextTable::SetNumberFormat" is not in camel caps format Open
public function SetNumberFormat($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
- Exclude checks
Method name "GTextTable::SetMinRowHeight" is not in camel caps format Open
public function SetMinRowHeight($aRowHeight, $aHeight = null)
- Exclude checks
Method name "_setcell" should not be prefixed with an underscore to indicate visibility Open
public function _setcell($aRow, $aCol, $aVal = '')
- Exclude checks
Method name "GTextTable::SetImage" is not in camel caps format Open
public function SetImage($aFileR1, $aScaleC1 = null, $aMixR2 = null, $aC2 = null, $aFile = null, $aScale = 1.0, $aMix = 100)
- Exclude checks
Method name "GTextTable::MergeCells" is not in camel caps format Open
public function MergeCells($aR1, $aC1, $aR2, $aC2, $aHAlign = 'center', $aVAlign = 'center')
- Exclude checks
Method name "GTextTable::SetColImage" is not in camel caps format Open
public function SetColImage($aCol, $aFile, $aScale = 1.0, $aMix = 100)
- Exclude checks
Method name "GTextTable::SetRowNumberFormat" is not in camel caps format Open
public function SetRowNumberFormat($aRow, $aF)
- Exclude checks
Method name "GTextTable::MergeCol" is not in camel caps format Open
public function MergeCol($aCol, $aHAlign = 'center', $aVAlign = 'center')
- Exclude checks
Method name "GTextTable::SetRowPadding" is not in camel caps format Open
public function SetRowPadding($aRow, $aPad)
- Exclude checks
Method name "GTextTable::SetColPadding" is not in camel caps format Open
public function SetColPadding($aCol, $aPad)
- Exclude checks
Method name "GTextTable::SetRowTextOrientation" is not in camel caps format Open
public function SetRowTextOrientation($aRow, $aO)
- Exclude checks
Method name "GTextTable::SetColTextOrientation" is not in camel caps format Open
public function SetColTextOrientation($aCol, $aO)
- Exclude checks
Method name "GTextTable::SetCellTextOrientation" is not in camel caps format Open
public function SetCellTextOrientation($aRow, $aCol, $aO)
- Exclude checks
Method name "GTextTable::SetRowGrid" is not in camel caps format Open
public function SetRowGrid($aRow, $aWeight = 1, $aColor = 'black', $aStyle = TGRID_SINGLE)
- Exclude checks
Method name "GTextTable::StrokeWithScale" is not in camel caps format Open
public function StrokeWithScale($aImg, $aXScale, $aYScale)
- Exclude checks
Method name "GTextTable::SetColNumberFormat" is not in camel caps format Open
public function SetColNumberFormat($aCol, $aF)
- Exclude checks
Method name "_chkR" should not be prefixed with an underscore to indicate visibility Open
public function _chkR($aRow)
- Exclude checks
Method name "GTextTable::SetCellCountryFlag" is not in camel caps format Open
public function SetCellCountryFlag($aRow, $aCol, $aFlag, $aScale = 1.0, $aMix = 100, $aStdSize = 3)
- Exclude checks
Method name "GTextTable::SetPadding" is not in camel caps format Open
public function SetPadding($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aPad = null)
- Exclude checks
Method name "GTextTable::SetCellColor" is not in camel caps format Open
public function SetCellColor($aRow, $aCol, $aColor)
- Exclude checks
Method name "GTextTable::SetFillColor" is not in camel caps format Open
public function SetFillColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
- Exclude checks
Method name "_getScalePos" should not be prefixed with an underscore to indicate visibility Open
public function _getScalePos()
- Exclude checks
Method name "_autoSizeTable" should not be prefixed with an underscore to indicate visibility Open
public function _autoSizeTable($aImg)
- Exclude checks
Method name "GTextTable::SetCellAlign" is not in camel caps format Open
public function SetCellAlign($aRow, $aCol, $aHorAlign, $aVertAlign = 'bottom')
- Exclude checks
Method name "GTextTable::SetColAlign" is not in camel caps format Open
public function SetColAlign($aCol, $aHorAlign, $aVertAlign = 'bottom')
- Exclude checks
Method name "GTextTable::SetMinColWidth" is not in camel caps format Open
public function SetMinColWidth($aColWidth, $aWidth = null)
- Exclude checks
Method name "GTextTable::SetColGrid" is not in camel caps format Open
public function SetColGrid($aCol, $aWeight = 1, $aColor = 'black', $aStyle = TGRID_SINGLE)
- Exclude checks
Method name "GTextTable::SetGrid" is not in camel caps format Open
public function SetGrid($aWeight = 1, $aColor = 'black', $aStyle = TGRID_SINGLE)
- Exclude checks
Method name "GTextTable::SetRowImage" is not in camel caps format Open
public function SetRowImage($aRow, $aFile, $aScale = 1.0, $aMix = 100)
- Exclude checks
Method name "GTextTable::Set" is not in camel caps format Open
public function Set($aArg1, $aArg2 = null, $aArg3 = null)
- Exclude checks
Method name "GTextTable::SetFont" is not in camel caps format Open
public function SetFont()
- Exclude checks
Method name "GTextTable::MergeRow" is not in camel caps format Open
public function MergeRow($aRow, $aHAlign = 'center', $aVAlign = 'center')
- Exclude checks
Method name "GTextTable::SetBorder" is not in camel caps format Open
public function SetBorder($aWeight = 1, $aColor = 'black')
- Exclude checks
Method name "GTextTable::SetCellFillColor" is not in camel caps format Open
public function SetCellFillColor($aRow, $aCol, $aColor)
- Exclude checks
Method name "GTextTable::SetCSIMTarget" is not in camel caps format Open
public function SetCSIMTarget($aTarget, $aAlt = null, $aAutoTarget = false)
- Exclude checks
Method name "GTextTable::SetCellCSIMTarget" is not in camel caps format Open
public function SetCellCSIMTarget($aRow, $aCol, $aTarget, $aAlt = null)
- Exclude checks
Method name "GTextTable::Init" is not in camel caps format Open
public function Init($aRows = 0, $aCols = 0, $aFillText = '')
- Exclude checks
Method name "GTextTable::SetAnchorPos" is not in camel caps format Open
public function SetAnchorPos($aXAnchor, $aYAnchor = 'top')
- Exclude checks
Method name "GTextTable::SetColor" is not in camel caps format Open
public function SetColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
- Exclude checks
Method name "GTextTable::SetColColor" is not in camel caps format Open
public function SetColColor($aCol, $aColor)
- Exclude checks
Method name "GTextTable::SetCellFont" is not in camel caps format Open
public function SetCellFont($aRow, $aCol, $aFF, $aFS, $aFSize = 10)
- Exclude checks
Method name "GTextTable::SetTextOrientation" is not in camel caps format Open
public function SetTextOrientation($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aO = null)
- Exclude checks
Method name "GTextTable::GetCSIMAreas" is not in camel caps format Open
public function GetCSIMAreas()
- Exclude checks
Method name "_chkC" should not be prefixed with an underscore to indicate visibility Open
public function _chkC($aCol)
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
public function SetImage($aFileR1, $aScaleC1 = null, $aMixR2 = null, $aC2 = null, $aFile = null, $aScale = 1.0, $aMix = 100)
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
- Exclude checks