PHPSocialNetwork/phpfastcache

View on GitHub
lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 6 of 6 total issues

Function getItem has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

public function getItem(string $key): ExtendedCacheItemInterface
{
/** @var ?ExtendedCacheItemInterface $item */
$item = null;
$eCount = 0;
Severity: Minor
Found in lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php - About 55 mins to fix

Function hasItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function hasItem(string $key): bool
{
$eCount = 0;
foreach ($this->clusterPools as $driverPool) {
try {
Severity: Minor
Found in lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php - About 25 mins to fix

Function clear has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function clear(): bool
{
$hasClearedOnce = false;
$eCount = 0;
 
 
Severity: Minor
Found in lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php - About 25 mins to fix

Function commit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function commit(): bool
{
$hasCommitOnce = false;
$eCount = 0;
 
 
Severity: Minor
Found in lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php - About 25 mins to fix

Function deleteItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function deleteItem(string $key): bool
{
$hasDeletedOnce = false;
$eCount = 0;
 
 
Severity: Minor
Found in lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php - About 25 mins to fix

Function save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function save(CacheItemInterface $item): bool
{
/** @var ExtendedCacheItemInterface $item */
$hasSavedOnce = false;
$eCount = 0;
Severity: Minor
Found in lib/Phpfastcache/Cluster/Drivers/SemiReplication/Driver.php - About 25 mins to fix
Category
Status