jaroslavtyc/drd-plus-tables

View on GitHub
src/History/SkillsByBackgroundPointsTable.php

Summary

Maintainability
A
3 hrs
Test Coverage

SkillsByBackgroundPointsTable has 30 functions (exceeds 20 allowed). Consider refactoring.
Open

class SkillsByBackgroundPointsTable extends AbstractFileTable
{
    private ?array $originalColumnsHeader = null;

    /**
Severity: Minor
Found in src/History/SkillsByBackgroundPointsTable.php - About 3 hrs to fix

    Avoid using static access to class '\DrdPlus\Codes\ProfessionCode' in method 'getThiefCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::THIEF));

    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\ProfessionCode' in method 'getWizardPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::WIZARD));

    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\ProfessionCode' in method 'getPriestCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::PRIEST));

    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\ProfessionCode' in method 'getExpectedDataHeaderNamesToTypes'.
    Open

            foreach (ProfessionCode::getPossibleValues() as $professionCode) {

    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\ProfessionCode' in method 'getWizardPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::WIZARD));

    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\ProfessionCode' in method 'getTheurgistPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::THEURGIST));

    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\ProfessionCode' in method 'getThiefPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::THIEF));

    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\ProfessionCode' in method 'getCommonerPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::COMMONER));

    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\ProfessionCode' in method 'getTheurgistCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::THEURGIST));

    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\ProfessionCode' in method 'getFighterCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::FIGHTER));

    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\Skills\SkillTypeCode' in method 'getExpectedDataHeaderNamesToTypes'.
    Open

                foreach (SkillTypeCode::getPossibleValues() as $skillTypeCode) {

    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\Skills\SkillTypeCode' in method 'getPhysicalSkillPoints'.
    Open

            return $this->getSkillPoints($backgroundPoints, $professionCode, SkillTypeCode::getIt(SkillTypeCode::PHYSICAL));

    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\ProfessionCode' in method 'getFighterPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::FIGHTER));

    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\Skills\SkillTypeCode' in method 'getCombinedSkillPoints'.
    Open

            return $this->getSkillPoints($backgroundPoints, $professionCode, SkillTypeCode::getIt(SkillTypeCode::COMBINED));

    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\ProfessionCode' in method 'getFighterPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::FIGHTER));

    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\ProfessionCode' in method 'getThiefPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::THIEF));

    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\ProfessionCode' in method 'getRangerCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::RANGER));

    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\ProfessionCode' in method 'getCommonerCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::COMMONER));

    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\ProfessionCode' in method 'getRebuiltOriginalColumnsHeader'.
    Open

                    ProfessionCode::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\ProfessionCode' in method 'getTheurgistPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::THEURGIST));

    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\ProfessionCode' in method 'getCommonerPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::COMMONER));

    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\Skills\SkillTypeCode' in method 'getPsychicalSkillPoints'.
    Open

            return $this->getSkillPoints($backgroundPoints, $professionCode, SkillTypeCode::getIt(SkillTypeCode::PSYCHICAL));

    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\ProfessionCode' in method 'getRangerPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::RANGER));

    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\ProfessionCode' in method 'getRangerPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::RANGER));

    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\ProfessionCode' in method 'getPriestPhysicalSkillPoints'.
    Open

            return $this->getPhysicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::PRIEST));

    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\ProfessionCode' in method 'getWizardCombinedSkillPoints'.
    Open

            return $this->getCombinedSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::WIZARD));

    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\ProfessionCode' in method 'getPriestPsychicalSkillPoints'.
    Open

            return $this->getPsychicalSkillPoints($backgroundPoints, ProfessionCode::getIt(ProfessionCode::PRIEST));

    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 excessively long variable names like $originalColumnsHeader. Keep variable name length under 20.
    Open

            $originalColumnsHeader = [];

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    Avoid excessively long variable names like $requiredColumnNotFound. Keep variable name length under 20.
    Open

            } catch (RequiredColumnNotFound $requiredColumnNotFound) {

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    Avoid excessively long variable names like $simplifiedColumnsHeader. Keep variable name length under 20.
    Open

                $simplifiedColumnsHeader = parent::getColumnsHeader();

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    Avoid excessively long variable names like $originalColumnsHeader. Keep variable name length under 20.
    Open

        private ?array $originalColumnsHeader = null;

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    Avoid excessively long variable names like $simplifiedColumnsHeader. Keep variable name length under 20.
    Open

        private function getRebuiltOriginalColumnsHeader(array $simplifiedColumnsHeader): array

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    Avoid excessively long variable names like $professionsWithSkillTypes. Keep variable name length under 20.
    Open

            $professionsWithSkillTypes = [];

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    There are no issues that match your filters.

    Category
    Status