jaroslavtyc/drd-plus-rolls-on

View on GitHub

Showing 6 of 105 total issues

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