steeffeen/FancyManiaLinks

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

Summary

Maintainability
A
1 hr
Test Coverage
F
48%

Method buildUpdateQuadDesignFunction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function buildUpdateQuadDesignFunction()
    {
        return "
Void " . self::FUNCTION_UPDATE_QUAD_DESIGN . "(CMlQuad _Quad) {
    declare " . self::VAR_CHECKBOX_ENABLED . " as Enabled for _Quad = True;
Severity: Minor
Found in FML/Script/Features/CheckBoxFeature.php - About 1 hr to fix

    Avoid using static access to class '\FML\Components\CheckBoxDesign' in method '__construct'.
    Open

            $this->setDisabledDesign(CheckBoxDesign::defaultDesign());

    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

    Avoid using static access to class '\FML\Script\Builder' in method 'buildInitScriptText'.
    Open

            $quadId  = Builder::getId($this->getQuad());

    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

    Avoid using static access to class '\FML\Script\Builder' in method 'buildInitScriptText'.
    Open

                $entryId = Builder::getId($this->getEntry());

    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

    Avoid using static access to class '\FML\Script\Builder' in method 'buildInitScriptText'.
    Open

            $default              = Builder::getBoolean($this->default);

    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

    Avoid using static access to class '\FML\Components\CheckBoxDesign' in method '__construct'.
    Open

            $this->setEnabledDesign(CheckBoxDesign::defaultDesign());

    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

    Avoid using static access to class '\FML\Script\Builder' in method 'buildClickScriptText'.
    Open

            $quadId = Builder::getId($this->getQuad());

    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 closing brace for the class must go on the next line after the body
    Open

    }

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

        public function getDefault()
        {
            return $this->default;
        }

    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