File Update.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use libraries\Backup;
/**
- Create a ticketCreate a ticket
Function restore_files_list
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function restore_files_list() {
if (is_readable(BACKUPFOLDER)) {
$dh = opendir(BACKUPFOLDER);
while ($filename = readdir($dh)) {
- 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 parse_md5
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function parse_md5($directory = null) {
$dir = null === $directory ? realpath('') : $directory;
$handle = opendir($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 add_to_ZIP
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function add_to_ZIP($files = []) {
if (empty($files)) {
throw new Exception(lang('Nothing to create', 'admin'));
}
- 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 query_from_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function query_from_file($file) {
$string_query = rtrim($file, "\n;");
$array_query = explode(";\n", $string_query);
- 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"