Showing 6 of 105 total issues
Method I_can_use_it
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function I_can_use_it()
{
$successfulRollOn = new SimpleRollOnSuccess(
$difficulty = 123,
$rollOnQuality = new RollOnQuality($preconditions = 456, $this->createRoll($rollValue = 789))
Method I_can_find_out_if_failed_just_moderately
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$roll,
$defiance,
$ride,
$ridingSkill,
$previousFailuresCount,
Method I_can_find_out_if_failed_fatally
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function I_can_find_out_if_failed_fatally($roll, $defiance, $ride, $ridingSkill, $previousFailuresCount, $isFatalFailure)
Function guardSameRollOnQuality
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private function guardSameRollOnQuality(array $simpleRollsOnSuccess)
{
/** @var RollOnQuality $rollOnQuality */
$rollOnQuality = null;
foreach ($simpleRollsOnSuccess as $simpleRollOnSuccess) {
- Read upRead up
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
Open
RollOnAgility $rollOnAgility,
AnimalDefiance $animalDefiance,
Ride $ride,
RidingSkill $ridingSkill,
PreviousFailuresCount $previousFailuresCount
Method createRollOnSuccess
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function createRollOnSuccess($class, $difficulty, RollOnQuality $rollOnQuality, $isSuccess, $resultValue)