steeffffeen/FancyManiaLinks

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

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

            $radioButtonIds[$radioButton->getName()] = Builder::getId($radioButton->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 'prepareRadioButtonClickScript'.
Open

    declare RadioButtonGroupEntry <=> (Page.GetFirstChild(\"" . Builder::getId($this->entry) . "\") as CMlEntry);

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

}

Line exceeds 120 characters; contains 137 characters
Open

    " . self::FUNCTION_ON_RADIO_BUTTON_CLICK . "(RadioButtonQuad, RadioButtonGroupEntry, " . $this->getRadioButtonIdsConstantName() . ");

Line exceeds 120 characters; contains 138 characters
Open

Void " . self::FUNCTION_ON_RADIO_BUTTON_CLICK . "(CMlQuad _RadioButtonQuad, CMlEntry _RadioButtonGroupEntry, Text[Text] _RadioButtonIds) {

Line exceeds 120 characters; contains 130 characters
Open

                declare " . CheckBoxFeature::VAR_CHECKBOX_ENABLED . " as OtherRadioButtonEnabled for OtherRadioButtonQuad = False;

There are no issues that match your filters.

Category
Status