Function Stroke
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($aImg)
{
// Constant
$fillBoxFrameWeight = 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 Stroke
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aImg)
{
// Constant
$fillBoxFrameWeight = 1;
File Legend.php
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* JPGraph v4.0.3
*/
The class Legend has an overall complexity of 73 which is very high. The configured complexity threshold is 50. Open
class Legend
{
public $txtcol = [];
public $font_family = FF_DEFAULT;
public $font_style = FS_NORMAL;
- Exclude checks
Legend
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Legend
{
public $txtcol = [];
public $font_family = FF_DEFAULT;
public $font_style = FS_NORMAL;
The class Legend has 32 fields. Consider redesigning Legend to keep the number of fields under 15. Open
class Legend
{
public $txtcol = [];
public $font_family = FF_DEFAULT;
public $font_style = FS_NORMAL;
- 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 Add
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function Add($aTxt, $aColor, $aPlotmark = '', $aLinestyle = 0, $csimtarget = '', $csimalt = '', $csimwintarget = '')
The method Stroke() has an NPath complexity of 197157888. The configured NPath complexity threshold is 200. Open
public function Stroke($aImg)
{
// Constant
$fillBoxFrameWeight = 1;
- 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 334 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function Stroke($aImg)
{
// Constant
$fillBoxFrameWeight = 1;
- Exclude checks
The method Stroke() has a Cyclomatic Complexity of 43. The configured cyclomatic complexity threshold is 10. Open
public function Stroke($aImg)
{
// Constant
$fillBoxFrameWeight = 1;
- 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 '$rowheight' which will lead to PHP notices. Open
$abs_height += $rowheight[$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 '$colwidth' which will lead to PHP notices. Open
$mtw += $colwidth[$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 '$rowheight' which will lead to PHP notices. Open
$y1 += $rowheight[$row];
- 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 '$rowheight' which will lead to PHP notices. Open
$rowheight[0] = 0;
- 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 '$rowheight' which will lead to PHP notices. Open
$rowheight[$rows - 1] = max($rowheight[$rows - 1], $h) + 1;
- 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 '$colwidth' which will lead to PHP notices. Open
$colwidth[$i % $numcolumns] = max(
- 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 '$colwidth' which will lead to PHP notices. Open
$colwidth[$i] = $aImg->GetTextWidth($this->txtcol[$i][0]) +
- 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 '$rowheight' which will lead to PHP notices. Open
$rowheight[$rows - 1] = max($rowheight[$rows - 1], $h) + 1;
- 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 '$rowheight' which will lead to PHP notices. Open
if (!empty($rowheight[$row])) {
- 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 '$colheight' which will lead to PHP notices. Open
$colheight[$i] = 0;
- 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 '$rowheight' which will lead to PHP notices. Open
$ye = $y1 - $rowheight[$row] + 1;
- 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 '$rowheight' which will lead to PHP notices. Open
$y1 = $yp + $rowheight[0] - $this->ylinespacing + 2; // The ymargin is included in rowheight
- 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 '$rowheight' which will lead to PHP notices. Open
$aImg->Rectangle($x1, $y1, $xp + $abs_width - 1, $y1 - $rowheight[$row]);
- 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 '$colwidth' which will lead to PHP notices. Open
$colwidth[$i % $numcolumns]
- 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 '$rowheight' which will lead to PHP notices. Open
$rowheight[$rows - 1] = 0;
- 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 '$colwidth' which will lead to PHP notices. Open
$x1 += $colwidth[($i - 1) % $numcolumns];
- 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 Hide has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation. Open
public function Hide($aHide = true)
- 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 SetReverse has a boolean flag argument $f, which is a certain sign of a Single Responsibility Principle violation. Open
public function SetReverse($f = true)
- 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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$xp = $aImg->width - $this->xabspos - $abs_width;
}
- 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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Draw a colored box
$color = $p[1];
// We make boxes slightly larger to better show
- 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 SetShadow uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->shadow = $aShow;
}
- 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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$aImg->SetColor($this->fill_color);
$aImg->FilledRectangle($xp, $yp, $xp + $abs_width, $yp + $abs_height);
$aImg->SetColor($this->color);
$aImg->Rectangle($xp, $yp, $xp + $abs_width, $yp + $abs_height);
- 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 'Pos'. Open
Util\JpGraphError::RaiseL(25120); //(" Position for legend must be given as percentage in range 0-1");
- 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 {
$aImg->SetColor($p[1]);
$aImg->FilledRectangle($x1 - $boxsize / 2, $ym, $x1 + $boxsize / 2, $ym + $boxsize);
}
- 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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (is_array($color) && safe_count($color) == 2) {
// The client want a gradient color
$grad->FilledRectangle(
$x1 - $boxsize / 2,
- 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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$p[2]->SetSize(min($this->mark_abs_vsize, $this->mark_abs_hsize));
$p[2]->Stroke($aImg, $x1, $marky);
}
- 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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$x1 += $colwidth[($i - 1) % $numcolumns];
++$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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Paragraph
$marky = $y1 - $aImg->GetTextHeight($p[0]) / 2;
// echo "y1=$y1, p[o]={$p[0]}, marky=$marky<br>";
- 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 '$ymargin'. Open
private $ymargin = 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 '$colheight'. Open
$colheight[$i] = 0;
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 22 and the first side effect is on line 22. Open
<?php
- Exclude checks
Avoid variables with short names like $aY. Configured minimum length is 3. Open
public function Pos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- 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 $yp. Configured minimum length is 3. Open
$yp = $this->yabspos;
- 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 $y1. Configured minimum length is 3. Open
$y1 = $yp + $rowheight[0] - $this->ylinespacing + 2; // The ymargin is included in rowheight
- 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, $aHAlign = 'right', $aVAlign = 'top')
- 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 Pos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- 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 $ys. Configured minimum length is 3. Open
$ys = $y1 + 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 $ye. Configured minimum length is 3. Open
$ye = $y1 - $rowheight[$row] + 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 SetPos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- 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 = max($this->mark_abs_vsize, $aImg->GetTextHeight($this->txtcol[$i][0])) + $this->ylinespacing;
- 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 $x1. Configured minimum length is 3. Open
$x1 = $xp + $this->xlmargin;
- 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 $xe. Configured minimum length is 3. Open
$xe = $x1 + $aImg->GetTextWidth($p[0]) + $this->mark_abs_hsize + $this->xmargin;
- 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 SetAbsPos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- 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 $ym. Configured minimum length is 3. Open
$ym = $marky - ceil($boxsize / 2); // Marker y-coordinate
- 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 = safe_count($this->txtcol);
- 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 $f. Configured minimum length is 3. Open
public function SetReverse($f = true)
- 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 $xp. Configured minimum length is 3. Open
$xp = $this->xabspos;
- 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 SetAbsPos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- 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 $xs. Configured minimum length is 3. Open
$xs = $x1 - $this->mark_abs_hsize;
- 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 "Legend::SetLayout" is not in camel caps format Open
public function SetLayout($aDirection = LEGEND_VERT)
- Exclude checks
Method name "Legend::SetAbsPos" is not in camel caps format Open
public function SetAbsPos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- Exclude checks
Method name "Legend::Add" is not in camel caps format Open
public function Add($aTxt, $aColor, $aPlotmark = '', $aLinestyle = 0, $csimtarget = '', $csimalt = '', $csimwintarget = '')
- Exclude checks
Method name "Legend::SetLineWeight" is not in camel caps format Open
public function SetLineWeight($aWeight)
- Exclude checks
Method name "Legend::SetColumns" is not in camel caps format Open
public function SetColumns($aCols)
- Exclude checks
Method name "Legend::SetBackgroundGradient" is not in camel caps format Open
public function SetBackgroundGradient($aFrom = 'navy', $aTo = 'silver', $aGradType = 2)
- Exclude checks
Method name "Legend::SetFillColor" is not in camel caps format Open
public function SetFillColor($aColor)
- Exclude checks
Method name "Legend::Stroke" is not in camel caps format Open
public function Stroke($aImg)
- Exclude checks
Method name "Legend::SetVColMargin" is not in camel caps format Open
public function SetVColMargin($aSpacing)
- Exclude checks
Method name "Legend::SetPos" is not in camel caps format Open
public function SetPos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- Exclude checks
Method name "Legend::Pos" is not in camel caps format Open
public function Pos($aX, $aY, $aHAlign = 'right', $aVAlign = 'top')
- Exclude checks
Method name "Legend::Clear" is not in camel caps format Open
public function Clear()
- Exclude checks
Method name "Legend::SetFrameWeight" is not in camel caps format Open
public function SetFrameWeight($aWeight)
- Exclude checks
Method name "Legend::SetMarkAbsVSize" is not in camel caps format Open
public function SetMarkAbsVSize($aSize)
- Exclude checks
Method name "Legend::SetMarkAbsSize" is not in camel caps format Open
public function SetMarkAbsSize($aSize)
- Exclude checks
Method name "Legend::SetReverse" is not in camel caps format Open
public function SetReverse($f = true)
- Exclude checks
Method name "Legend::SetLineSpacing" is not in camel caps format Open
public function SetLineSpacing($aSpacing)
- Exclude checks
Method name "Legend::Hide" is not in camel caps format Open
public function Hide($aHide = true)
- Exclude checks
Method name "Legend::SetLeftMargin" is not in camel caps format Open
public function SetLeftMargin($aXMarg)
- Exclude checks
Method name "Legend::SetColor" is not in camel caps format Open
public function SetColor($aFontColor, $aColor = 'black')
- Exclude checks
Method name "Legend::HasItems" is not in camel caps format Open
public function HasItems()
- Exclude checks
Method name "Legend::SetMarkAbsHSize" is not in camel caps format Open
public function SetMarkAbsHSize($aSize)
- Exclude checks
Method name "Legend::SetShadow" is not in camel caps format Open
public function SetShadow($aShow = 'gray', $aWidth = 4)
- Exclude checks
Method name "Legend::GetCSIMAreas" is not in camel caps format Open
public function GetCSIMAreas()
- Exclude checks
Method name "Legend::SetFont" is not in camel caps format Open
public function SetFont($aFamily, $aStyle = FS_NORMAL, $aSize = 10)
- Exclude checks
Method name "Legend::SetHColMargin" is not in camel caps format Open
public function SetHColMargin($aXMarg)
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
public function Add($aTxt, $aColor, $aPlotmark = '', $aLinestyle = 0, $csimtarget = '', $csimalt = '', $csimwintarget = '')
- Exclude checks