HuasoFoundries/jpgraph

View on GitHub
src/graph/Ticks.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Ticks has 22 fields. Consider redesigning Ticks to keep the number of fields under 15.
Open

class Ticks
{
    public $label_formatstr         = ''; // C-style format string to use for labels
    public $label_formfunc          = '';
    public $label_dateformatstr     = '';
Severity: Minor
Found in src/graph/Ticks.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 SupressMinorTickMarks has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function SupressMinorTickMarks($aHide = true)
Severity: Minor
Found in src/graph/Ticks.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

The method SupressFirst has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function SupressFirst($aHide = true)
Severity: Minor
Found in src/graph/Ticks.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

The method SetLabelFormat has a boolean flag argument $aDate, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function SetLabelFormat($aFormatString, $aDate = false)
Severity: Minor
Found in src/graph/Ticks.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

The method SupressLast has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function SupressLast($aHide = true)
Severity: Minor
Found in src/graph/Ticks.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

The method SupressZeroLabel has a boolean flag argument $aFlag, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function SupressZeroLabel($aFlag = true)
Severity: Minor
Found in src/graph/Ticks.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

The method SupressTickMarks has a boolean flag argument $aHide, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function SupressTickMarks($aHide = true)
Severity: Minor
Found in src/graph/Ticks.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

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->mincolor = $aMinorColor;
        }
Severity: Minor
Found in src/graph/Ticks.php by phpmd

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 excessively long variable names like $supress_minor_tickmarks. Keep variable name length under 20.
Open

    public $supress_minor_tickmarks = false;
Severity: Minor
Found in src/graph/Ticks.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 "Ticks::SetSide" is not in camel caps format
Open

    public function SetSide($aSide)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SetSize" is not in camel caps format
Open

    public function SetSize($aMajSize, $aMinSize = 3)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::GetMajTickAbsSize" is not in camel caps format
Open

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

Method name "Ticks::IsSpecified" is not in camel caps format
Open

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

Method name "Ticks::SetMarkColor" is not in camel caps format
Open

    public function SetMarkColor($aMajorColor, $aMinorColor = '')
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SetLabelFormat" is not in camel caps format
Open

    public function SetLabelFormat($aFormatString, $aDate = false)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SupressTickMarks" is not in camel caps format
Open

    public function SupressTickMarks($aHide = true)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SetWeight" is not in camel caps format
Open

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

Method name "Ticks::SupressMinorTickMarks" is not in camel caps format
Open

    public function SupressMinorTickMarks($aHide = true)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SupressFirst" is not in camel caps format
Open

    public function SupressFirst($aHide = true)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SupressZeroLabel" is not in camel caps format
Open

    public function SupressZeroLabel($aFlag = true)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SetDirection" is not in camel caps format
Open

    public function SetDirection($aSide = SIDE_RIGHT)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SetLabelDateFormat" is not in camel caps format
Open

    public function SetLabelDateFormat($aFormatString)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SetFormatCallback" is not in camel caps format
Open

    public function SetFormatCallback($aCallbackFuncName)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::SupressLast" is not in camel caps format
Open

    public function SupressLast($aHide = true)
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

Method name "Ticks::GetMinTickAbsSize" is not in camel caps format
Open

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

Method name "Ticks::SetColor" is not in camel caps format
Open

    public function SetColor($aMajorColor, $aMinorColor = '')
Severity: Minor
Found in src/graph/Ticks.php by phpcodesniffer

There are no issues that match your filters.

Category
Status