Showing 10 of 32 total issues
Method getStateSchema
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getStateSchema(): array
{
return [
"type" => "assoc" ,
"required" => false,
Function splat
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function splat(): array
{
$initial_state = null;
$all_states = new StateMap;
$final_states = new StateMap;
- 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 __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(StateMap $states, TransitionSet $transitions)
{
$this->internal_map = new Map;
foreach ($transitions as $transition) {
$from_state = $transition->getFrom();
- 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 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(StateMap $states, TransitionSet $transitions)
{
$this->internal_map = new Map;
foreach ($transitions as $transition) {
$from_state = $transition->getFrom();
Function realizeConfig
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function realizeConfig(array $config): array
{
$states = [];
$transitions = [];
foreach ($config as $name => $state_config) {
- 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 realizeConfig
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function realizeConfig(array $config): array
{
$states = [];
$transitions = [];
foreach ($config as $name => $state_config) {
- 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 withParam
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function withParam(string $param_name, $param_value, bool $treat_name_as_path = true): ParamHolderInterface
{
$param_holder = clone $this;
if ($treat_name_as_path) {
$name_parts = array_reverse(explode('.', $param_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
Function activateTransition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function activateTransition(InputInterface $input, OutputInterface $output)
{
$next_state = null;
foreach ($this->state_transitions->get($output->getCurrentState()) as $transition) {
if ($transition->isActivatedBy($input, $output)) {
- 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 resolveStateImplementor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function resolveStateImplementor(Maybe $state): string
{
switch (true) {
case $state->initial->get():
$state_implementor = $this->class_map->get('initial');
- 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 createTransition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createTransition(string $from, string $to, array $config = null): TransitionInterface
{
$transition = Maybe::unit($config);
if (is_string($transition->when->get())) {
$config['when'] = [ $transition->when->get() ];
- 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"