Showing 25 of 36 total issues
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 LegacyHttpOGMTranslator.php
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
- 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
File Map.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
- Create a ticketCreate a ticket
Map
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Map extends AbstractCypherSequence
{
/**
* @param iterable<mixed, TValue>|callable():Generator<mixed, TValue> $iterable
*
- Create a ticketCreate a ticket
Function getJoltBody
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function getJoltBody(string $contents): stdClass
{
// Split json sequence in single jsons, split on json sequence separators.
$contents = explode("\036", $contents);
- 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
Method getJoltBody
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getJoltBody(string $contents): stdClass
{
// Split json sequence in single jsons, split on json sequence separators.
$contents = explode("\036", $contents);
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ($key === '' ||
str_contains($key, '{') ||
str_contains($key, '}') ||
str_contains($key, '(') ||
str_contains($key, ')') ||
- Create a ticketCreate a ticket
Function translateValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function translateValue(float|array|bool|int|string|stdClass|null $value, HttpMetaInfo $meta): array
{
if (is_object($value)) {
return $this->translateObject($value, $meta);
}
- 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 __construct
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($iterable = [])
{
if (is_array($iterable)) {
$i = 0;
foreach ($iterable as $key => $value) {
- 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
Method translatePoint
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function translatePoint(stdClass $value): PointInterface
{
/** @var stdClass $crs */
$crs = $value->crs;
/** @var array{0: float, 1: float, 2:float} $coordinates */
- Create a ticketCreate a ticket
Method translateString
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function translateString(string $value, HttpMetaInfo $meta): array
{
switch ($meta->getCurrentType()) {
case 'duration':
$meta = $meta->incrementMeta();
- Create a ticketCreate a ticket
Function retry
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function retry(callable $tsxFactory, callable $tsxHandler)
{
while (true) {
$transaction = null;
try {
- 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
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($iterable = [])
{
if (is_array($iterable)) {
$i = 0;
foreach ($iterable as $key => $value) {
- 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 convertTemporalTypes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function convertTemporalTypes(mixed $value, ConnectionProtocol $protocol): ?IStructure
{
if ($protocol->isBolt()) {
if ($value instanceof DateTimeInterface) {
if ($protocol->compare(ConnectionProtocol::BOLT_V44()) > 0) {
- 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 translateString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function translateString(string $value, HttpMetaInfo $meta): array
{
switch ($meta->getCurrentType()) {
case 'duration':
$meta = $meta->incrementMeta();
- 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 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
Consider simplifying this complex logical expression. Open
if (!($protocol instanceof V4_4 || $protocol instanceof V5 || $protocol instanceof V5_1 || $protocol instanceof V5_2 || $protocol instanceof V5_3 || $protocol instanceof V5_4)) {
throw new RuntimeException('Client only supports bolt version 4.4 and ^5.0');
}
- Create a ticketCreate a ticket