steeffeen/FancyManiaLinks

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

Summary

Maintainability
A
1 hr
Test Coverage
F
55%

Method buildUpdatePickerValueFunction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function buildUpdatePickerValueFunction()
    {
        return "
Void " . self::FUNCTION_UPDATE_PICKER_VALUE . "(CMlLabel _Label) {
    declare " . self::VAR_PICKER_VALUES . " as Values for _Label = Text[Integer];
Severity: Minor
Found in FML/Script/Features/ValuePickerFeature.php - About 1 hr to fix

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

            $values  = Builder::getArray($this->values);

    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

            $labelId = Builder::getId($this->label);

    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::escapeText($this->getDefault());

    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

            $labelId = Builder::getId($this->label);

    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->entry);

    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

    }

    There are no issues that match your filters.

    Category
    Status