Function set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function set($cacheName, $data, $cacheDir = false, $flag = false)
{
$cacheDir = $cacheDir == false ? self::$cacheDir : $cacheDir;
if (defined('__FILEROOT__')) {
$dir = __FILEROOT__;
Avoid using undefined variables such as '$cacheName' which will lead to PHP notices.
$dir = $dir.$cacheDir."/".$cacheName;
The method get has a boolean flag argument $cacheDir, which is a certain sign of a Single Responsibility Principle violation.
public function get($cacheName, $cacheDir = false)
The method isExist has a boolean flag argument $cacheDir, which is a certain sign of a Single Responsibility Principle violation.
public function isExist($cacheName, $cacheDir = false)
The method set has a boolean flag argument $cacheDir, which is a certain sign of a Single Responsibility Principle violation.
public function set($cacheName, $data, $cacheDir = false, $flag = false)
The method set has a boolean flag argument $flag, which is a certain sign of a Single Responsibility Principle violation.
public function set($cacheName, $data, $cacheDir = false, $flag = false)
Remove error control operator '@' on line 95.
public function remove($filename, $cacheDir = false)
{
$cacheDir = $cacheDir == false ? self::$cacheDir : $cacheDir;
if (defined('__FILEROOT__')) {
$dir = __FILEROOT__;
The method remove has a boolean flag argument $cacheDir, which is a certain sign of a Single Responsibility Principle violation.
public function remove($filename, $cacheDir = false)
The method isExist uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$dir = __ROOT__;
}
The method set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$dir = __ROOT__;
}
The method get uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$dir = __ROOT__;
}
The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$dir = __ROOT__;
}
Avoid unused local variables such as '$cacheName'.
$dir = $dir.$cacheDir."/".$cacheName;
Avoid unused parameters such as '$filename'.
public function remove($filename, $cacheDir = false)
Function closing brace must go on the next line following the body; found 1 blank lines before brace
}
Inline control structures are not allowed
if ($this->isExist($cacheName, $cacheDir)) return require_once $dir;
There are no issues that match your filters.