averias/phpredis-bloom

View on GitHub

Showing 5 of 7 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function cuckooFilterInsertIfNotExist(string $key, array $items, array $options = []): array
{
$this->validateArrayOfScalars($items, sprintf("%s params", BloomCommands::CF_INSERTNX));
$parsedOptions = $this->parseRequest(BloomCommands::CF_INSERTNX, $options);
$items = array_merge([OptionalParams::ITEMS], $items);
src/RedisBloomClient/Command/CuckooFilter/CuckooFilterCommandTrait.php on lines 52..60

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function cuckooFilterInsert(string $key, array $items, array $options = []): array
{
$this->validateArrayOfScalars($items, sprintf("%s params", BloomCommands::CF_INSERT));
$parsedOptions = $this->parseRequest(BloomCommands::CF_INSERT, $options);
$items = array_merge([OptionalParams::ITEMS], $items);
src/RedisBloomClient/Command/CuckooFilter/CuckooFilterCommandTrait.php on lines 65..73

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function copy(string $targetFilter): bool
{
try {
$iterator = 0;
while (true) {
Severity: Minor
Found in src/RedisBloomClient/DataTypes/CuckooFilter.php and 1 other location - About 55 mins to fix
src/RedisBloomClient/DataTypes/BloomFilter.php on lines 89..105

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function copy(string $targetFilter): bool
{
try {
$iterator = 0;
while (true) {
Severity: Minor
Found in src/RedisBloomClient/DataTypes/BloomFilter.php and 1 other location - About 55 mins to fix
src/RedisBloomClient/DataTypes/CuckooFilter.php on lines 122..138

Function parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public function parse($optionalParams)
{
$result = [];
if (empty($optionalParams)) {
return $result;
Severity
Category
Status
Source
Language