Showing 38 of 53 total issues
Function onDatabaseSync
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function onDatabaseSync(DatabaseSyncEvent $databaseSyncEvent): void
{
foreach ($this->em->getMetadataFactory()->getAllMetadata() as $metadata) {
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($metadata instanceof ClassMetadata) {
- 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 denormalize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
{
if (isset($context[DenormalizerInterface::COLLECT_DENORMALIZATION_ERRORS], $context['not_normalizable_value_exceptions'])) {
throw new LogicException('Passing a value for "not_normalizable_value_exceptions" context key is not allowed.');
}
- 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 denormalize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
{
if (isset($context[DenormalizerInterface::COLLECT_DENORMALIZATION_ERRORS], $context['not_normalizable_value_exceptions'])) {
throw new LogicException('Passing a value for "not_normalizable_value_exceptions" context key is not allowed.');
}
Method normalize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalize(mixed $data, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null|
DateTimeInterface|
DateInterval|
Neo4j\Date|
Neo4j\Time|
Function createClient
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function createClient(array $config, LoggerInterface $logger): Neo4jClient
{
if (!array_key_exists('drivers', $config)) {
throw new InvalidConfigurationException('Missing configuration client.drivers');
}
- 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 build
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function build(array $relations, CreateType $createType = CreateType::MERGE): array
{
if (empty($relations)) {
return [];
}
- 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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$event = new GetAllIndicesEvent();
- 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 build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function build(Node $node): array
{
$statements = [
...MergeNodeStatementBuilder::build($node),
];
- 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 build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function build(array $nodes): array
{
if (empty($nodes)) {
return [];
}
- 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 current
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function current(): array
{
/** @var class-string $className */
$className = $this->className;
$elements = $this->em->getRepository($this->className)
- 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 getNeo4jIndices
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getNeo4jIndices(): array
{
$res = $this->client->runStatement(GetIndicesStatementBuilder::build()[0]);
$indices = [];
foreach ($res as $element) {
- 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 createBatchArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function createBatchArray(array $relations): array
{
$batch = [];
foreach ($relations as $relation) {
$identifier = $relation->getIdentifier();
- 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
Avoid too many return
statements within this method. Open
return $normalized;
Avoid too many return
statements within this method. Open
return $a->isEqualTo($b);
Function onGetAllIndices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onGetAllIndices(GetAllIndicesEvent $getAllIndicesEvent): void
{
foreach ($this->em->getMetadataFactory()->getAllMetadata() as $metadata) {
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($metadata instanceof ClassMetadata) {
- 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 onDatabaseSync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onDatabaseSync(DatabaseSyncEvent $databaseSyncEvent): void
{
foreach ($this->em->getMetadataFactory()->getAllMetadata() as $metadata) {
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($metadata instanceof ClassMetadata) {
- 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 onDatabaseSync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onDatabaseSync(DatabaseSyncEvent $databaseSyncEvent): void
{
foreach ($this->em->getMetadataFactory()->getAllMetadata() as $metadata) {
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($metadata instanceof ClassMetadata) {
- 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 build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function build(array $relations): array
{
if (empty($relations)) {
return [];
}
- 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"