AbstractCypherSequence
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractCypherSequence implements Countable, JsonSerializable, ArrayAccess, Iterator
{
/** @var list<TKey> */
protected array $keyCache = [];
/** @var array<TKey, TValue> */
- Create a ticketCreate a ticket
File AbstractCypherSequence.php
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (((is_array($value) && array_key_exists($key, $value)) || ($value instanceof ArrayAccess && $value->offsetExists($key))) && $this->isStringable($value[$key])) {
yield $value[$key] => $value;
} elseif (is_object($value) && property_exists($value, $key) && $this->isStringable($value->$key)) {
yield $value->$key => $value;
} else {
- Create a ticketCreate a ticket
Function pluck
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function pluck(string $key): ArrayList
{
return new ArrayList(function () use ($key) {
foreach ($this as $value) {
if ((is_array($value) && array_key_exists($key, $value)) || ($value instanceof ArrayAccess && $value->offsetExists($key))) {
- Read upRead up
- Create a ticketCreate a ticket
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 keyBy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function keyBy(string $key): Map
{
return new Map(function () use ($key) {
foreach ($this as $value) {
if (((is_array($value) && array_key_exists($key, $value)) || ($value instanceof ArrayAccess && $value->offsetExists($key))) && $this->isStringable($value[$key])) {
- Read upRead up
- Create a ticketCreate a ticket
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 next
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function next(): void
{
$generator = $this->getGenerator();
if ($this->cache === []) {
$this->setupCache();
- Read upRead up
- Create a ticketCreate a ticket
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"