jaroslavtyc/drd-plus-codes

View on GitHub

Showing 591 of 591 total issues

Avoid using static access to class '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'I_can_get_projectile_category_codes'.
Open

            $projectileCategory = WeaponCategoryCode::getIt($code);

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 '\DrdPlus\Codes\Body\OrdinaryWoundOriginCode' in method 'I_can_use_it'.
Open

        $ordinaryWoundOrigin = OrdinaryWoundOriginCode::getIt();

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 '\DrdPlus\Codes\CombatActions\CombatActionCode' in method 'I_can_get_ranged_only_codes'.
Open

            CombatActionCode::getPossibleValues()

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 '\Granam\Tools\ValueDescriber' in method 'checkTranslationsFormat'.
Open

                        'Expected non-empty string, got ' . ValueDescriber::describe($translation)

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 'DrdPlus\Codes\Properties\RemarkableSenseCode' in method 'getRemarkableSensePropertyPossibleValues'.
Open

        return RemarkableSenseCode::getPossibleValues();
Severity: Minor
Found in Codes/Properties/PropertyCode.php by phpmd

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 '\DrdPlus\Codes\CombatActions\MeleeCombatActionCode' in method 'I_can_get_melee_only_codes'.
Open

        self::assertSame($expectedMeleeOnly, MeleeCombatActionCode::getMeleeOnlyCombatActionValues());

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 '\DrdPlus\Codes\Body\OrdinaryWoundOriginCode' in method 'I_can_use_it'.
Open

        $sameOrdinaryWoundOrigin = OrdinaryWoundOriginCode::getIt(OrdinaryWoundOriginCode::ORDINARY);

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 '\DrdPlus\Codes\Body\OrdinaryWoundOriginCode' in method 'I_can_not_create_custom_ordinary_origin'.
Open

        OrdinaryWoundOriginCode::getEnum('Kitchen accident');

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 class SpellCode has 1062 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class SpellCode extends TranslatableCode
{
    // TIME-SPACE
    public const MAGIC_ARMOR = 'magic_armor';
    public const PROJECTILE = 'projectile';
Severity: Minor
Found in Codes/Wizard/SpellCode.php by phpmd

The method fetchTranslations() has 501 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    protected function fetchTranslations(): array
    {
        return [
            'en' => [
                // TIME-SPACE
Severity: Minor
Found in Codes/Wizard/SpellCode.php by phpmd

Avoid using static access to class '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'I_can_get_melee_weapon_category_codes_at_once'.
Open

            $meleeCategory = WeaponCategoryCode::getIt($code);

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 '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'getRandomWeaponCategoryCode'.
Open

            $category = WeaponCategoryCode::getIt(
                $this->getWeaponCategoryValues()[array_rand($this->getWeaponCategoryValues())]
            );

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 '\DrdPlus\Codes\GenderCode' in method 'I_can_ask_it_if_is_male_or_female'.
Open

        $female = GenderCode::getIt(GenderCode::FEMALE);
Severity: Minor
Found in tests/Codes/GenderCodeTest.php by phpmd

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 '\DrdPlus\Codes\Armaments\RangedWeaponCode' in method 'I_can_not_convert_anything_to_melee_weapon_code'.
Open

        $rangeWeapon = RangedWeaponCode::getIt(RangedWeaponCode::MINICROSSBOW);

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 '\DrdPlus\Codes\Armaments\RangedWeaponCode' in method 'I_can_not_extended_it_by_same_code_but_different_category'.
Open

        self::assertNotContains('corge', RangedWeaponCode::getPossibleValues());

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 '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_convert_spear_to_melee_weapon_code'.
Open

        self::assertSame(MeleeWeaponCode::getIt(MeleeWeaponCode::SPEAR), $meleeSpear);

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 '\DrdPlus\Codes\Armaments\RangedWeaponCode' in method 'I_can_distinguish_throwing_and_shooting_weapon'.
Open

        $rangeWeaponCode = RangedWeaponCode::getIt($rangeWeaponCodeValue);

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 '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'I_can_get_ranged_weapon_category_codes'.
Open

            $rangedCategory = WeaponCategoryCode::getIt($code);

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 unused parameters such as '$weaponlikeCode'.
Open

    protected function isSameCodeAllowedFor(string $weaponlikeCode, string $interferingCodeClass): bool

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid using static access to class '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'I_can_get_projectile_category_codes'.
Open

            WeaponCategoryCode::getProjectileCategoryValues()

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

Severity
Category
Status
Source
Language