Showing 334 of 371 total issues
Function glob_dir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function glob_dir($dir) {
$dir = new DirectoryIterator($dir);
foreach ($dir as $fileinfo) {
if ($fileinfo->isDot()) {
continue;
- Read upRead up
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 output
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function output() {
$num_lines = 0;
$cols = exec('tput cols');
printf("Watching every %ds:%s%s\n", $this->refresh_interval, str_repeat(' ', $cols - 50), date('r'));
- Read upRead up
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_line_hook
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function parse_line_hook($name, $value) {
if (string_starts_with($name, CONFIG_HOOK)) {
if (!preg_match('/hook\[([^]]+)]/', $name, $re)) {
Log::warn("Can't parse the following config line: $name; ignoring.", Log::EVENT_CODE_CONFIG_UNPARSEABLE_LINE);
return TRUE;
- Read upRead up
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 migrate_9_complete_writen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function migrate_9_complete_writen() {
$query = "DESCRIBE tasks";
$rows = DB::getAll($query);
foreach ($rows as $row) {
if ($row->Field == 'complete') {
- Read upRead up
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 confirmFsckCommand
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function confirmFsckCommand() {
let params = getFsckParams();
let command = "greyhole --fsck ";
for (let k in params) {
let v = params[k];
- Read upRead up
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 migrate_3_larger_settings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function migrate_3_larger_settings() {
$query = "DESCRIBE settings";
$rows = DB::getAll($query);
foreach ($rows as $row) {
if ($row->Field == 'value') {
- Read upRead up
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 gh_symlink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function gh_symlink($target, $link) {
global $use_alt_symlinks_creation;
$success = !$use_alt_symlinks_creation && symlink($target, $link);
if (!$success) {
exec("ln -s " . escapeshellarg($target) . " " . escapeshellarg($link));
- Read upRead up
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 gh_is_file_locked
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function gh_is_file_locked($real_fullpath) {
if (is_link($real_fullpath)) {
$real_fullpath = readlink($real_fullpath);
}
$result = exec("lsof -n -P -l " . escapeshellarg($real_fullpath) . " 2> /dev/null");
- Read upRead up
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
Avoid too many return
statements within this method. Open
if (self::parse_line_frozen($name, $value)) return;
Avoid too many return
statements within this method. Open
if (self::parse_line_drive_selection($name, $value)) return;
Avoid too many return
statements within this method. Open
return TRUE;
Avoid too many return
statements within this method. Open
return -1;
Avoid too many return
statements within this method. Open
return FALSE;
Avoid too many return
statements within this method. Open
if (self::parse_line_share_option($name, $value)) return;
Avoid too many return
statements within this method. Open
return FALSE;
Avoid too many return
statements within this method. Open
return TRUE;
Avoid too many return
statements within this method. Open
return TRUE;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return 1;
Avoid too many return
statements within this method. Open
if (self::parse_line_pool_drive($name, $value)) return;