Showing 17 of 116 total issues
Function run
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function run(WorkflowControl $control, WorkflowContainer $container): void
{
$iteration = 0;
WorkflowState::getRunningWorkflow()->setInLoop(true);
- 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 renderWorkflowGraph
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function renderWorkflowGraph(string $workflowName, array $steps): string
{
$dotScript = sprintf(" %s [label=\"$workflowName\"]\n", self::$stepIndex++);
foreach ($steps as $stage => $stageSteps) {
$dotScript .= sprintf(
Method run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(WorkflowControl $control, WorkflowContainer $container): void
{
$iteration = 0;
WorkflowState::getRunningWorkflow()->setInLoop(true);
Function wrapStepExecution
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function wrapStepExecution(WorkflowStep $step, WorkflowState $workflowState): void {
try {
($this->resolveMiddleware($step, $workflowState))();
} catch (SkipStepException | FailStepException $exception) {
$workflowState->addExecutionLog(
- 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 executeWorkflow
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function executeWorkflow(
WorkflowContainer $workflowContainer = null,
bool $throwOnFailure = true
): WorkflowResult {
if (!$workflowContainer) {
Method wrapStepExecution
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function wrapStepExecution(WorkflowStep $step, WorkflowState $workflowState): void {
try {
($this->resolveMiddleware($step, $workflowState))();
} catch (SkipStepException | FailStepException $exception) {
$workflowState->addExecutionLog(
Function renderWorkflowGraph
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function renderWorkflowGraph(string $workflowName, array $steps): string
{
$dotScript = sprintf(" %s [label=\"$workflowName\"]\n", self::$stepIndex++);
foreach ($steps as $stage => $stageSteps) {
$dotScript .= sprintf(
- 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 runStage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function runStage(WorkflowState $workflowState): ?Stage
{
$workflowState->setStage(WorkflowState::STAGE_VALIDATE);
// make sure hard validators are executed first
- 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 runStage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function runStage(WorkflowState $workflowState): ?Stage
{
$workflowState->setStage(WorkflowState::STAGE_VALIDATE);
// make sure hard validators are executed first
Function check
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function check(WorkflowContainer $container): void
{
if (!$container->has($this->key)) {
throw new WorkflowStepDependencyNotFulfilledException("Missing '$this->key' in container");
}
- 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
public function __construct(Describable $step, string $state, ?string $reason, array $stepInfo, int $warnings)
Avoid too many return
statements within this method. Open
case WorkflowState::STAGE_AFTER: return 'After';
Avoid too many return
statements within this method. Open
case WorkflowState::STAGE_ON_SUCCESS: return 'On Success';
Avoid too many return
statements within this method. Open
default: return "{$this->indentation} - " . $info->getInfo();
Avoid too many return
statements within this method. Open
case WorkflowState::STAGE_ON_ERROR: return 'On Error';
Avoid too many return
statements within this method. Open
case WorkflowState::STAGE_SUMMARY: return 'Summary';
Function executeWorkflow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function executeWorkflow(
WorkflowContainer $workflowContainer = null,
bool $throwOnFailure = true
): WorkflowResult {
if (!$workflowContainer) {
- 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"