HuasoFoundries/jpgraph

View on GitHub
src/graph/HeaderProperty.php

Summary

Maintainability
A
0 mins
Test Coverage

The class HeaderProperty has 16 fields. Consider redesigning HeaderProperty to keep the number of fields under 15.
Open

class HeaderProperty
{
    public $grid;
    public $iShowLabels             = true;
    public $iShowGrid               = true;
Severity: Minor
Found in src/graph/HeaderProperty.php by phpmd

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 $aShow, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function Show($aShow = true)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpmd

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

Avoid excessively long variable names like $iWeekendBackgroundColor. Keep variable name length under 20.
Open

    public $iWeekendBackgroundColor = 'lightgray';
Severity: Minor
Found in src/graph/HeaderProperty.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Method name "HeaderProperty::SetFormatString" is not in camel caps format
Open

    public function SetFormatString($aStr)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::Show" is not in camel caps format
Open

    public function Show($aShow = true)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetBackgroundColor" is not in camel caps format
Open

    public function SetBackgroundColor($aColor)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetLabelFormatString" is not in camel caps format
Open

    public function SetLabelFormatString($aStr)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetFont" is not in camel caps format
Open

    public function SetFont($aFFamily, $aFStyle = FS_NORMAL, $aFSize = 10)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetFrameColor" is not in camel caps format
Open

    public function SetFrameColor($aColor)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetIntervall" is not in camel caps format
Open

    public function SetIntervall($aInt)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::GetFontHeight" is not in camel caps format
Open

    public function GetFontHeight($aImg)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetFrameWeight" is not in camel caps format
Open

    public function SetFrameWeight($aWeight)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::GetFontWidth" is not in camel caps format
Open

    public function GetFontWidth($aImg)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetTitleVertMargin" is not in camel caps format
Open

    public function SetTitleVertMargin($aMargin)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetWeekendColor" is not in camel caps format
Open

    public function SetWeekendColor($aColor)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetSundayFontColor" is not in camel caps format
Open

    public function SetSundayFontColor($aColor)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::GetStrWidth" is not in camel caps format
Open

    public function GetStrWidth($aImg, $aStr)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetInterval" is not in camel caps format
Open

    public function SetInterval($aInt)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::GetIntervall" is not in camel caps format
Open

    public function GetIntervall()
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetStyle" is not in camel caps format
Open

    public function SetStyle($aStyle)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

Method name "HeaderProperty::SetFontColor" is not in camel caps format
Open

    public function SetFontColor($aColor)
Severity: Minor
Found in src/graph/HeaderProperty.php by phpcodesniffer

There are no issues that match your filters.

Category
Status