jaroslavtyc/drd-plus-rolls-on

View on GitHub

Showing 105 of 105 total issues

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

        BonusFromUsedRemarkableSense $bonusFromUsedRemarkableSense
Severity: Minor
Found in src/Traps/RollOnSenses.php by phpmd

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 $previousFailuresCount. Keep variable name length under 20.
Open

        $previousFailuresCount,

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 $shortRollOnIntelligence. Keep variable name length under 20.
Open

    public function I_can_fail_and_succeed(ShortRollOnIntelligence $shortRollOnIntelligence, $difficulty, $isSuccess, $expectedResult)

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 $previousFailuresCount. Keep variable name length under 20.
Open

        $previousFailuresCount = $this->mockery(PreviousFailuresCount::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

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

    public function I_can_find_out_if_failed_fatally($roll, $defiance, $ride, $ridingSkill, $previousFailuresCount, $isFatalFailure)

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 $extendedRollOnSuccess. Keep variable name length under 20.
Open

        $extendedRollOnSuccess = $extendedRollOnSuccessReflection->newInstanceArgs($simpleRollsOnSuccess);

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 $extendedRollOnSuccess. Keep variable name length under 20.
Open

        $extendedRollOnSuccess = new ExtendedRollOnSuccess(

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 $secondSimpleRollOnSuccess. Keep variable name length under 20.
Open

        SimpleRollOnSuccess $secondSimpleRollOnSuccess = 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 $expectedRollOnQuality. Keep variable name length under 20.
Open

    public function I_can_use_it(RollOnQuality $expectedRollOnQuality, array $simpleRollsOnSuccess, string $expectedResultCode, bool $expectingSuccess)

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 $previousFailuresCount. Keep variable name length under 20.
Open

        PreviousFailuresCount $previousFailuresCount

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 $basePropertyNamespace. Keep variable name length under 20.
Open

        $basePropertyNamespace = (new \ReflectionClass(BaseProperty::class))->getNamespaceName();

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 $shortRollOnIntelligence. Keep variable name length under 20.
Open

    public function __construct(ShortRollOnIntelligence $shortRollOnIntelligence, $difficulty)

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 $extendedRollOnSuccess. Keep variable name length under 20.
Open

        $extendedRollOnSuccess = new ExtendedRollOnSuccess(

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 $bonusFromUsedRemarkableSense. Keep variable name length under 20.
Open

    private $bonusFromUsedRemarkableSense;
Severity: Minor
Found in src/Traps/RollOnSenses.php by phpmd

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

Method I_can_use_it has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function I_can_use_it()
    {
        $successfulRollOn = new SimpleRollOnSuccess(
            $difficulty = 123,
            $rollOnQuality = new RollOnQuality($preconditions = 456, $this->createRoll($rollValue = 789))
Severity: Minor
Found in tests/RollsOn/QualityAndSuccess/SimpleRollOnSuccessTest.php - About 1 hr to fix

    Method I_can_find_out_if_failed_just_moderately has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $roll,
            $defiance,
            $ride,
            $ridingSkill,
            $previousFailuresCount,
    Severity: Major
    Found in tests/RollsOn/QualityAndSuccess/RollOnAnimalControlTest.php - About 50 mins to fix

      Method I_can_find_out_if_failed_fatally has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function I_can_find_out_if_failed_fatally($roll, $defiance, $ride, $ridingSkill, $previousFailuresCount, $isFatalFailure)
      Severity: Minor
      Found in tests/RollsOn/QualityAndSuccess/RollOnAnimalControlTest.php - About 45 mins to fix

        Function guardSameRollOnQuality has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private function guardSameRollOnQuality(array $simpleRollsOnSuccess)
            {
                /** @var RollOnQuality $rollOnQuality */
                $rollOnQuality = null;
                foreach ($simpleRollsOnSuccess as $simpleRollOnSuccess) {
        Severity: Minor
        Found in src/QualityAndSuccess/ExtendedRollOnSuccess.php - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                RollOnAgility $rollOnAgility,
                AnimalDefiance $animalDefiance,
                Ride $ride,
                RidingSkill $ridingSkill,
                PreviousFailuresCount $previousFailuresCount
        Severity: Minor
        Found in src/QualityAndSuccess/RollOnAnimalControl.php - About 35 mins to fix

          Method createRollOnSuccess has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private function createRollOnSuccess($class, $difficulty, RollOnQuality $rollOnQuality, $isSuccess, $resultValue)
          Severity: Minor
          Found in tests/RollsOn/QualityAndSuccess/ExtendedRollOnSuccessTest.php - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language