Showing 9 of 11 total issues
Function recurse
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
protected function recurse($param = null, int $nodeIdx = 0)
{
while ($nodeIdx <= $this->lastIdx) {
$node = $this->nodes[$nodeIdx];
$this->nodeIdx = $nodeIdx;
- 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 getStats
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getStats(): array
{
$this->resetTotals();
foreach ($this->flow->getNodes() as $node) {
$nodeMap = $this->nodeMap[$node->getId()];
- 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 recurse
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function recurse($param = null, int $nodeIdx = 0)
{
while ($nodeIdx <= $this->lastIdx) {
$node = $this->nodes[$nodeIdx];
$this->nodeIdx = $nodeIdx;
Function getTraversable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getTraversable($param = null): iterable
{
$value = null;
/** @var $nodes TraversableNodeInterface[] */
$nodes = $this->payload->getNodes();
- 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 enforceIsATraversable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function enforceIsATraversable(): self
{
if ($this->isFlow()) {
if ($this->isATraversable) {
throw new NodalFlowException('Cannot Traverse a Branch');
- 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 listActiveEvent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function listActiveEvent(bool $reload = false): self
{
if (!isset($this->dispatcher) || (isset($this->activeEvents) && !$reload)) {
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 setFlowIncrement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function setFlowIncrement(array $flowIncrements): self
{
foreach ($flowIncrements as $incrementKey => $target) {
if (is_string($target)) {
if (!isset($this->flowStats[$target])) {
- 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 setNodeIncrement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function setNodeIncrement(NodeInterface $node): self
{
$nodeId = $node->getId();
foreach ($node->getNodeIncrements() as $incrementKey => $target) {
if (is_string($target)) {
- 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 resetNodeStats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function resetNodeStats(): FlowMapInterface
{
foreach ($this->nodeMap as &$nodeStat) {
foreach ($this->nodeIncrements as $key => $value) {
if (isset($nodeStat[$key])) {
- 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"