src/plot/LegendStyle.php
The class LegendStyle has 23 fields. Consider redesigning LegendStyle to keep the number of fields under 15. Open
Open
class LegendStyle
{
public $iLength = 40;
public $iMargin = 20;
public $iBottomMargin = 5;
- 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 Show has a boolean flag argument $aFlg, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function Show($aFlg = 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 $aFlg, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function Hide($aFlg = 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
Method name "LegendStyle::SetFont" is not in camel caps format Open
Open
public function SetFont($aFontFamily, $aFontStyle = FS_NORMAL, $aFontSize = 10)
- Exclude checks
Method name "LegendStyle::SetCFontColor" is not in camel caps format Open
Open
public function SetCFontColor($aColor)
- Exclude checks
Method name "LegendStyle::SetFontColor" is not in camel caps format Open
Open
public function SetFontColor($aColor)
- Exclude checks
Method name "LegendStyle::Show" is not in camel caps format Open
Open
public function Show($aFlg = true)
- Exclude checks
Method name "LegendStyle::Hide" is not in camel caps format Open
Open
public function Hide($aFlg = true)
- Exclude checks
Method name "LegendStyle::SetCircleWeight" is not in camel caps format Open
Open
public function SetCircleWeight($aWeight)
- Exclude checks
Method name "LegendStyle::SetCircleRadius" is not in camel caps format Open
Open
public function SetCircleRadius($aRadius)
- Exclude checks
Method name "LegendStyle::SetCircleColor" is not in camel caps format Open
Open
public function SetCircleColor($aColor)
- Exclude checks
Method name "LegendStyle::SetCFont" is not in camel caps format Open
Open
public function SetCFont($aFontFamily, $aFontStyle = FS_NORMAL, $aFontSize = 10)
- Exclude checks
Method name "LegendStyle::SetLFontColor" is not in camel caps format Open
Open
public function SetLFontColor($aColor)
- Exclude checks
Method name "LegendStyle::SetMargin" is not in camel caps format Open
Open
public function SetMargin($aMarg, $aBottomMargin = 5)
- Exclude checks
Method name "LegendStyle::SetText" is not in camel caps format Open
Open
public function SetText($aTxt)
- Exclude checks
Method name "LegendStyle::SetLFont" is not in camel caps format Open
Open
public function SetLFont($aFontFamily, $aFontStyle = FS_NORMAL, $aFontSize = 10)
- Exclude checks
Method name "LegendStyle::SetTFont" is not in camel caps format Open
Open
public function SetTFont($aFontFamily, $aFontStyle = FS_NORMAL, $aFontSize = 10)
- Exclude checks
Method name "LegendStyle::SetCircleText" is not in camel caps format Open
Open
public function SetCircleText($aTxt)
- Exclude checks
Method name "LegendStyle::SetLength" is not in camel caps format Open
Open
public function SetLength($aLength)
- Exclude checks
Method name "LegendStyle::SetFormat" is not in camel caps format Open
Open
public function SetFormat($aFmt)
- Exclude checks
Method name "LegendStyle::SetTFontColor" is not in camel caps format Open
Open
public function SetTFontColor($aColor)
- Exclude checks