Function backupFiles
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function backupFiles() {
$lockedFiles = $this->getSetting('lockedFiles');
if (!is_array($lockedFiles)) {
$lockedFiles = [];
}
- 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 backupFiles
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function backupFiles() {
$lockedFiles = $this->getSetting('lockedFiles');
if (!is_array($lockedFiles)) {
$lockedFiles = [];
}
- Create a ticketCreate a ticket
Method deleteOldFiles
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteOldFiles() {
$term = $this->getSetting('backup_term');
$maxSize = ($this->getSetting('backup_maxsize') * 1024 * 1024);
$maxSize = 5 * 1024 * 1024;
- Create a ticketCreate a ticket
Function createBackup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function createBackup($ext, $prefix = NULL, $fullName = FALSE, $params = []) {
if (is_really_writable($this->directory)) {
if ($prefix == null) {
$prefix = 'sql';
}
- 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 getOldestFileToDelete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getOldestFileToDelete() {
$files_ = $this->backupFiles();
// getting only files that allow to delete by pattern
$files = [];
foreach ($files_ as $file) {
- 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 deleteOldFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function deleteOldFiles() {
$term = $this->getSetting('backup_term');
$maxSize = ($this->getSetting('backup_maxsize') * 1024 * 1024);
$maxSize = 5 * 1024 * 1024;
- 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 getSetting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getSetting($key = NULL) {
$result = $this->ci->db->select('backup')->get('settings');
if ($result) {
$row = $result->result_array();
} else {
- 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"