steeffeen/FancyManiaLinks

View on GitHub
FML/Script/Features/Clock.php

Summary

Maintainability
A
0 mins
Test Coverage
A
96%

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

    public function __construct(Label $label = null, $showSeconds = true, $showFullDate = false)
Severity: Minor
Found in FML/Script/Features/Clock.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 __construct has a boolean flag argument $showFullDate, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function __construct(Label $label = null, $showSeconds = true, $showFullDate = false)
Severity: Minor
Found in FML/Script/Features/Clock.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 closing brace for the class must go on the next line after the body
Open

}

The 'getShowSeconds()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getShowSeconds()
    {
        return $this->showSeconds;
    }
Severity: Minor
Found in FML/Script/Features/Clock.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

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

The 'getShowFullDate()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getShowFullDate()
    {
        return $this->showFullDate;
    }
Severity: Minor
Found in FML/Script/Features/Clock.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

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

There are no issues that match your filters.

Category
Status