Function delete_all
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function delete_all() {
$n = 0;
$cache_store_dir = $this->_Config['store'] . '/';
if (is_dir($cache_store_dir) and ( $root_dir_handle = opendir($cache_store_dir))) {
- Read upRead up
- Create a ticketCreate a ticket
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 cache_file
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function cache_file() {
$n = 0;
$cache_store_dir = $this->_Config['store'] . '/';
if (is_dir($cache_store_dir) and ( $root_dir_handle = opendir($cache_store_dir))) {
- Read upRead up
- Create a ticketCreate a ticket
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 cache.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
- Create a ticketCreate a ticket
Function Clean
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function Clean() {
if (!($dh = opendir($this->_Config['store']))) {
$this->log_cache_error('Clean :: Error Opening Store ' . $this->_Config['store']);
return false;
}
- Read upRead up
- Create a ticketCreate a ticket
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 clearCacheFolder
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function clearCacheFolder($folder = NULL) {
if ($folder !== NULL) {
if ($files_all = opendir('./system/cache/' . $folder . '/')) {
while (false !== ($fileT = readdir($files_all))) {
- Read upRead up
- Create a ticketCreate a ticket
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 delete_all
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete_all() {
$n = 0;
$cache_store_dir = $this->_Config['store'] . '/';
if (is_dir($cache_store_dir) and ( $root_dir_handle = opendir($cache_store_dir))) {
- Create a ticketCreate a ticket
Method Clean
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Clean() {
if (!($dh = opendir($this->_Config['store']))) {
$this->log_cache_error('Clean :: Error Opening Store ' . $this->_Config['store']);
return false;
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (substr($file, 0, 6) != 'cache_' && $file != 'hooks.php' && $file != '.' && $file != '..' && $file != '/' && strstr($file, '.') != TRUE && (time() - $stat['mtime']) > $this->_Config['auto_clean_life']) {
$files_all = opendir('./system/cache/' . $file);
while (false !== ($fileT = readdir($files_all))) {
$stat = stat($this->_Config['store']);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ($fileT != '.' && $fileT != '..' && $fileT != '/' && (time() - @$stat['mtime']) > $this->_Config['auto_clean_life']) {
@unlink('./system/cache/' . $file . '/' . $fileT);
$n++;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
while (false !== ($fileT = readdir($sub_dir_handle))) {
if ($fileT != '.' && $fileT != '..' && $fileT != '/' && strstr($fileT, '~') != TRUE) {
$n++;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
while (FALSE !== ($fileT = readdir($sub_dir_handle))) {
if ($fileT != '.' && $fileT != '..' && $fileT != '/') {
$n++;
- Create a ticketCreate a ticket