AxisPrototype
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class AxisPrototype
{
public $scale;
public $img;
public $hide = false;
The class AxisPrototype has 29 fields. Consider redesigning AxisPrototype to keep the number of fields under 15. Open
class AxisPrototype
{
public $scale;
public $img;
public $hide = false;
- 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
The method HideFirstTickLabel has a boolean flag argument $aShow, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideFirstTickLabel($aShow = 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 HideLastTickLabel has a boolean flag argument $aShow, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideLastTickLabel($aShow = 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 HideTicks has a boolean flag argument $aHideMinor, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideTicks($aHideMinor = true, $aHideMajor = 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 HideTicks has a boolean flag argument $aHideMajor, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideTicks($aHideMinor = true, $aHideMajor = 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 SetLabelFormatString has a boolean flag argument $aDate, which is a certain sign of a Single Responsibility Principle violation. Open
public function SetLabelFormatString($aFormStr, $aDate = 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 HideZeroLabel has a boolean flag argument $aFlag, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideZeroLabel($aFlag = 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 SetColor has a boolean flag argument $aLabelColor, which is a certain sign of a Single Responsibility Principle violation. Open
public function SetColor($aColor, $aLabelColor = 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 HideLine has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideLine($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 HideLabels has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation. Open
public function HideLabels($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 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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->title_margin = 5;
$this->title_adjust = 'high';
$this->title->SetOrientation(0);
$this->tick_label_margin = 5;
- 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 'SetTextLabelInterval'. Open
Util\JpGraphError::RaiseL(25058); //(" Text label interval must be specified >= 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 SetColor uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->label_color = $aLabelColor;
}
- 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 parameters such as '$aFlag'. Open
public function HideZeroLabel($aFlag = true)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Method name "AxisPrototype::HideZeroLabel" is not in camel caps format Open
public function HideZeroLabel($aFlag = true)
- Exclude checks
Method name "AxisPrototype::Hide" is not in camel caps format Open
public function Hide($aHide = true)
- Exclude checks
Method name "AxisPrototype::SetColor" is not in camel caps format Open
public function SetColor($aColor, $aLabelColor = false)
- Exclude checks
Method name "AxisPrototype::SetTitleSide" is not in camel caps format Open
public function SetTitleSide($aSideOfAxis)
- Exclude checks
Method name "AxisPrototype::SetLabelFormatString" is not in camel caps format Open
public function SetLabelFormatString($aFormStr, $aDate = false)
- Exclude checks
Method name "AxisPrototype::SetTickPositions" is not in camel caps format Open
public function SetTickPositions($aMajPos, $aMinPos = null, $aLabels = null)
- Exclude checks
Method name "AxisPrototype::SetTitle" is not in camel caps format Open
public function SetTitle($aTitle, $aAdjustAlign = 'high')
- Exclude checks
Method name "AxisPrototype::SetPosAbsDelta" is not in camel caps format Open
public function SetPosAbsDelta($aDelta)
- Exclude checks
Method name "AxisPrototype::HideFirstLastLabel" is not in camel caps format Open
public function HideFirstLastLabel()
- Exclude checks
Method name "AxisPrototype::SetWeight" is not in camel caps format Open
public function SetWeight($aWeight)
- Exclude checks
Method name "AxisPrototype::HideTicks" is not in camel caps format Open
public function HideTicks($aHideMinor = true, $aHideMajor = true)
- Exclude checks
Method name "AxisPrototype::HideFirstTickLabel" is not in camel caps format Open
public function HideFirstTickLabel($aShow = false)
- Exclude checks
Method name "AxisPrototype::SetTickSide" is not in camel caps format Open
public function SetTickSide($aDir)
- Exclude checks
Method name "AxisPrototype::SetLabelFormat" is not in camel caps format Open
public function SetLabelFormat($aFormStr)
- Exclude checks
Method name "AxisPrototype::SetTickLabels" is not in camel caps format Open
public function SetTickLabels($aLabelArray, $aLabelColorArray = null)
- Exclude checks
Method name "AxisPrototype::SetTextLabelInterval" is not in camel caps format Open
public function SetTextLabelInterval($aStep)
- Exclude checks
Method name "AxisPrototype::SetLabelAlign" is not in camel caps format Open
public function SetLabelAlign($aHAlign, $aVAlign = 'top', $aParagraphAlign = 'left')
- Exclude checks
Method name "AxisPrototype::SetMajTickPositions" is not in camel caps format Open
public function SetMajTickPositions($aMajPos, $aLabels = null)
- Exclude checks
Method name "AxisPrototype::HideLine" is not in camel caps format Open
public function HideLine($aHide = true)
- Exclude checks
Method name "AxisPrototype::SetTitleMargin" is not in camel caps format Open
public function SetTitleMargin($aMargin)
- Exclude checks
Method name "AxisPrototype::SetTickSize" is not in camel caps format Open
public function SetTickSize($aMajSize, $aMinSize = 3)
- Exclude checks
Method name "AxisPrototype::SetTextTickInterval" is not in camel caps format Open
public function SetTextTickInterval($aStep, $aStart = 0)
- Exclude checks
Method name "AxisPrototype::HideLabels" is not in camel caps format Open
public function HideLabels($aHide = true)
- Exclude checks
Method name "AxisPrototype::SetLabelFormatCallback" is not in camel caps format Open
public function SetLabelFormatCallback($aFuncName)
- Exclude checks
Method name "AxisPrototype::SetLabelAngle" is not in camel caps format Open
public function SetLabelAngle($aAngle)
- Exclude checks
Method name "AxisPrototype::SetPos" is not in camel caps format Open
public function SetPos($aPosOnOtherScale)
- Exclude checks
Method name "AxisPrototype::SetLabelMargin" is not in camel caps format Open
public function SetLabelMargin($aMargin)
- Exclude checks
Method name "AxisPrototype::SetLabelSide" is not in camel caps format Open
public function SetLabelSide($aSidePos)
- Exclude checks
Method name "AxisPrototype::HideLastTickLabel" is not in camel caps format Open
public function HideLastTickLabel($aShow = false)
- Exclude checks
Method name "AxisPrototype::SetFont" is not in camel caps format Open
public function SetFont($aFamily, $aStyle = FS_NORMAL, $aSize = 10)
- Exclude checks