jaroslavtyc/drd-plus-tables

View on GitHub
tests/Tables/Riding/RidingAnimalsTableTest.php

Summary

Maintainability
B
4 hrs
Test Coverage

Method I_can_get_all_values has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function I_can_get_all_values()
    {
        self::assertSame(
            $expectedValues = [
                RidingAnimalCode::HORSE => [
Severity: Major
Found in tests/Tables/Riding/RidingAnimalsTableTest.php - About 4 hrs to fix

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

        public function I_can_get_all_values()
        {
            self::assertSame(
                $expectedValues = [
                    RidingAnimalCode::HORSE => [

    Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_domesticated'.
    Open

                    RidingAnimalCode::getIt(RidingAnimalCode::YAK),

    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\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_wild'.
    Open

                    RidingAnimalCode::getIt(RidingAnimalCode::BULL),

    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\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_wild'.
    Open

                    RidingAnimalCode::getIt(RidingAnimalCode::BULL),

    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\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_wild'.
    Open

                    RidingAnimalCode::getIt(RidingAnimalCode::BULL),

    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\Transport\RidingAnimalCode' in method 'I_can_get_maximal_load'.
    Open

            self::assertSame(11, (new RidingAnimalsTable())->getMaximalLoad(RidingAnimalCode::getIt(RidingAnimalCode::HINNY)));

    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\Transport\RidingAnimalCode' in method 'I_can_get_endurance'.
    Open

            self::assertSame(4, (new RidingAnimalsTable())->getEndurance(RidingAnimalCode::getIt(RidingAnimalCode::COW)));

    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\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_domesticated'.
    Open

                    RidingAnimalCode::getIt(RidingAnimalCode::YAK),

    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\Transport\RidingAnimalCode' in method 'I_can_get_speed'.
    Open

            self::assertSame(-2, (new RidingAnimalsTable())->getSpeed(RidingAnimalCode::getIt(RidingAnimalCode::BULL)));

    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\Transport\RidingAnimalCode' in method 'I_can_get_maximal_load_in_kg'.
    Open

            self::assertSame(110, (new RidingAnimalsTable())->getMaximalLoadInKg(RidingAnimalCode::getIt(RidingAnimalCode::PONY)));

    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 local variables such as '$expectedValues'.
    Open

                $expectedValues = [

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

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

    Avoid unused local variables such as '$givenValues'.
    Open

                $givenValues = (new RidingAnimalsTable())->getIndexedValues()

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

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

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

            $defianceOfWildPercents = $this->mockery(DefianceOfWildPercents::class);

    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

    The method I_can_get_maximal_load is not named in camelCase.
    Open

        public function I_can_get_maximal_load()
        {
            self::assertSame(11, (new RidingAnimalsTable())->getMaximalLoad(RidingAnimalCode::getIt(RidingAnimalCode::HINNY)));
        }

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_header is not named in camelCase.
    Open

        public function I_can_get_header()
        {
            self::assertSame(
                [
                    [

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_speed is not named in camelCase.
    Open

        public function I_can_get_speed()
        {
            self::assertSame(-2, (new RidingAnimalsTable())->getSpeed(RidingAnimalCode::getIt(RidingAnimalCode::BULL)));
        }

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_maximal_load_in_kg is not named in camelCase.
    Open

        public function I_can_get_maximal_load_in_kg()
        {
            self::assertSame(110, (new RidingAnimalsTable())->getMaximalLoadInKg(RidingAnimalCode::getIt(RidingAnimalCode::PONY)));
        }

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_defiance_of_wild is not named in camelCase.
    Open

        public function I_can_get_defiance_of_wild()
        {
            self::assertSame(
                19,
                (new RidingAnimalsTable())->getDefianceOfWild(

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_all_values is not named in camelCase.
    Open

        public function I_can_get_all_values()
        {
            self::assertSame(
                $expectedValues = [
                    RidingAnimalCode::HORSE => [

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_endurance is not named in camelCase.
    Open

        public function I_can_get_endurance()
        {
            self::assertSame(4, (new RidingAnimalsTable())->getEndurance(RidingAnimalCode::getIt(RidingAnimalCode::COW)));
        }

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method I_can_get_defiance_of_domesticated is not named in camelCase.
    Open

        public function I_can_get_defiance_of_domesticated()
        {
            self::assertSame(
                5,
                (new RidingAnimalsTable())->getDefianceOfDomesticated(

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status