Showing 58 of 58 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(bool $autoStartEnabled = true, bool $autoTerminateEnabled = true, bool $dataIsolateEnabled = false, bool $debugModeEnabled = false, bool $delegatorModeEnabled = false, ?IdProvider $idProvider = null)
Method create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function create(?string $stateMachineClazz = null,
?string $stateClass = 'string',
?string $eventClass = 'string',
?string $contextClazz = null,
array $extraConstParamTypes = [],
Function internalFire
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function internalFire($event, $context, bool $insertAtFirst = false): void
{
if ($this->getStatus() == 'INITIALIZED') {
if ($this->autoStartEnabled) {
$this->start($context);
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public $xception,
public $from,
public $currentState,
public $event,
public $context,
Method defer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function defer($action, $from, $to, $event, $context, $stateMachine): void
Method isMatch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function isMatch($fromState, $toState, $event, int $priority, ?string $condClazz = null, ?string $type = null): bool
Method isMatch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function isMatch($fromState, $toState, $event, int $priority, ?string $condClazz = null, ?string $type = null): bool;
Method defer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function defer(Action $action, $from, $to, $event, $context, $stateMachine): void;
Method processEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function processEvent($event, $context, StateMachineData $originalData, ExecutionServiceImpl $executionService, bool $DataIsolateEnabled): bool
Method __invoke
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __invoke($from, $to, $event, $context, $stateMachine)
Method defineTimedState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function defineTimedState($stateId, int $initialDelay, int $timeInterval, $autoEvent, $autoContext): MutableState
Method defineTimedState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function defineTimedState($stateId, int $initialDelay, int $timeInterval, $autoEvent, $autoContext): MutableState;
Function processEvent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function processEvent($event, $context, StateMachineData $originalData, ExecutionServiceImpl $executionService, bool $DataIsolateEnabled): bool
{
$localData = $originalData;
$fromState = $localData->read()->getCurrentRawState();
$fromStateId = $fromState->getStateId();
- 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
Function buildDeclareState
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function buildDeclareState(State $state): void
{
// Preconditions.checkState(stateConverter!=null, "Do not register state converter");
$stateId = $state->name;
// Preconditions.checkNotNull(stateId, "Cannot convert state of name \""+state.name()+"\".");
- 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
Avoid too many return
statements within this method. Open
return true;
Function internalFire
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function internalFire(StateContext $stateContext): void
{
// Fix issue17
if ($this->type == TransitionType::INTERNAL && $stateContext->getSourceState()->getStateId() != $this->targetState->getStateId()) {
return;
- 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
Function enterByHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function enterByHistory($stateContext): ImmutableState
{
if ($this->finalState || $this->isParallelState()) // no historical info
return this;
- 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
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function run(ActionContext $context, Container $containerOrigin): Container
{
// init container to isolate for each action
$container = new Container($containerOrigin);
$container['from'] = Container::value($context->from);
- 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"