Function getItems
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getItems(array $keys = []): iterable
{
$items = [];
/**
- 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
File CacheItemPoolTrait.php
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* This file is part of Phpfastcache.
Function getItem
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getItem(string $key): ExtendedCacheItemInterface
{
/**
* Replace array_key_exists by isset
* due to performance issue on huge
- 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 getItems
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItems(array $keys = []): iterable
{
$items = [];
/**
Function deleteItems
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function deleteItems(array $keys): bool
{
if (count($keys) > 1) {
$return = true;
try {
- 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 getItem
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItem(string $key): ExtendedCacheItemInterface
{
/**
* Replace array_key_exists by isset
* due to performance issue on huge
Method deleteItems
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteItems(array $keys): bool
{
if (count($keys) > 1) {
$return = true;
try {
Method save
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save(CacheItemInterface $item): bool
{
$this->assertCacheItemType($item, self::getItemClass());
/**
* @var ExtendedCacheItemInterface $item
Function save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function save(CacheItemInterface $item): bool
{
$this->assertCacheItemType($item, self::getItemClass());
/**
* @var ExtendedCacheItemInterface $item
- 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 commit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function commit(): bool
{
$this->eventManager->dispatch(Event::CACHE_COMMIT_ITEM, $this, new EventReferenceParameter($this->deferredList));
if (\count($this->deferredList)) {
- 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"