jaroslavtyc/drd-plus-stamina

View on GitHub

Showing 88 of 88 total issues

Avoid too many return statements within this method.
Open

                return PropertyCode::INTELLIGENCE === $usedProperty;
Severity: Major
Found in tests/Stamina/MalusFromFatigueTest.php - About 30 mins to fix

    Avoid using static access to class '\DrdPlus\Stamina\MalusFromFatigue' in method 'I_can_get_final_malus_value_according_to_activity'.
    Open

            $oddMalus = MalusFromFatigue::getIt(-2);

    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\Stamina\Fatigue' in method '__construct'.
    Open

            $this->fatigue = Fatigue::getIt(0);
    Severity: Minor
    Found in Stamina/Stamina.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\Calculations\SumAndRound' in method 'calculateFilledHalfRowsFor'.
    Open

                $halves = [SumAndRound::ceiledHalf($fatiguePerRowMaximum), SumAndRound::flooredHalf($fatiguePerRowMaximum)];
    Severity: Minor
    Found in Stamina/GridOfFatigue.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\Stamina\MalusFromFatigue' in method 'I_can_not_create_worse_malus_than_minus_three'.
    Open

            MalusFromFatigue::getIt(-4);

    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\Stamina\MalusFromFatigue' in method 'I_can_get_final_malus_value_according_to_activity'.
    Open

            $evenMalus = MalusFromFatigue::getIt(-3);

    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\Stamina\ReasonToRollAgainstMalusFromFatigue' in method 'I_can_use_rest_reason'.
    Open

            self::assertSame(ReasonToRollAgainstMalusFromFatigue::getIt('rest'), $restReason);

    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\Calculations\SumAndRound' in method 'getNumberOfFilledRows'.
    Open

            $numberOfFilledRows = SumAndRound::floor($this->stamina->getFatigue()->getValue() / $this->getFatiguePerRowMaximum($fatigueBoundary));
    Severity: Minor
    Found in Stamina/GridOfFatigue.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\Stamina\ReasonToRollAgainstMalusFromFatigue' in method 'resolveMalusAfterRest'.
    Open

                $this->reasonToRollAgainstMalusFromFatigue = ReasonToRollAgainstMalusFromFatigue::getRestReason();
    Severity: Minor
    Found in Stamina/Stamina.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\Stamina\MalusFromFatigue' in method 'I_can_use_it'.
    Open

            $malusFromFatigue = MalusFromFatigue::getIt(0);

    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\Stamina\ReasonToRollAgainstMalusFromFatigue' in method 'I_can_use_fatigue_reason'.
    Open

            $fatigueReason = ReasonToRollAgainstMalusFromFatigue::getFatigueReason();

    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\Stamina\ReasonToRollAgainstMalusFromFatigue' in method 'I_can_use_fatigue_reason'.
    Open

            self::assertSame(ReasonToRollAgainstMalusFromFatigue::getIt('fatigue'), $fatigueReason);

    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\Stamina\ReasonToRollAgainstMalusFromFatigue' in method 'I_should_roll_against_malus_from_fatigue_because_of_new_fatigue'.
    Open

            self::assertSame(ReasonToRollAgainstMalusFromFatigue::getFatigueReason(), $stamina->getReasonToRollAgainstMalusFromFatigue());
    Severity: Minor
    Found in tests/Stamina/StaminaTest.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\Calculations\SumAndRound' in method 'getValueForActivity'.
    Open

            return SumAndRound::half($this->getValue());
    Severity: Minor
    Found in Stamina/MalusFromFatigue.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 '\Granam\Tools\ValueDescriber' in method 'convertToEnumFinalValue'.
    Open

                    'Expected one of ' . self::FATIGUE . ' or ' . self::REST . ', got ' . ValueDescriber::describe($enumValue)

    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\Stamina\MalusFromFatigue' in method '__construct'.
    Open

            $this->malusFromFatigue = MalusFromFatigue::getIt(0);
    Severity: Minor
    Found in Stamina/Stamina.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\Stamina\MalusFromFatigue' in method 'setMalusFromFatigue'.
    Open

            return $this->malusFromFatigue = MalusFromFatigue::getIt($rollOnWillAgainstMalus->getMalusValue());
    Severity: Minor
    Found in Stamina/Stamina.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\Stamina\Fatigue' in method 'I_can_not_use_negative_value'.
    Open

            Fatigue::getEnum(-1);
    Severity: Minor
    Found in tests/Stamina/FatigueTest.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\Stamina\MalusFromFatigue' in method 'getMalusFromFatigue'.
    Open

                return MalusFromFatigue::getIt(0);
    Severity: Minor
    Found in Stamina/Stamina.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\Stamina\Fatigue' in method 'I_am_stopped_by_specific_exception_on_invalid_value'.
    Open

            Fatigue::getIt('Drastic teaching');
    Severity: Minor
    Found in tests/Stamina/FatigueTest.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

    Severity
    Category
    Status
    Source
    Language