bluetree-service/cache

View on GitHub

Showing 8 of 8 total issues

Avoid excessively long variable names like $multipleSetExceptions. Keep variable name length under 20.
Open

    protected $multipleSetExceptions = [];
Severity: Minor
Found in src/SimpleCache.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $cacheCommitExceptions. Keep variable name length under 20.
Open

    protected $cacheCommitExceptions = [];
Severity: Minor
Found in src/Cache.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Missing class import via use statement (line '136', column '38').
Open

                $this->expire = (new \DateTime)
Severity: Minor
Found in src/CacheItem.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method delete has a boolean flag argument $isKey, which is a certain sign of a Single Responsibility Principle violation.
Open

    protected function delete($key, $isKey = true)
Severity: Minor
Found in src/Storage/File.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method clearMany has a boolean flag argument $isKey, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function clearMany(array $list, $isKey = true)
Severity: Minor
Found in src/Storage/File.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method clearMany has a boolean flag argument $isKey, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function clearMany(array $list, $isKey = true);
Severity: Minor
Found in src/Storage/StorageInterface.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Remove error control operator '@' on line 49.
Open

    public function store(CacheItemInterface $item)
    {
        $data = serialize($item);
        $key = $item->getKey();

Severity: Minor
Found in src/Storage/File.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 212.
Open

    protected function delete($key, $isKey = true)
    {
        if ($isKey) {
            unset($this->currentCache[$key]);
            $key = $this->getFilePath($key);
Severity: Minor
Found in src/Storage/File.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Severity
Category
Status
Source
Language