Showing 1,065 of 16,781 total issues
Function _distro
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _distro()
{
if (CommonFunctions::rfts('/etc/release', $buf, 1, 4096, false) && (trim($buf)!="")) {
$this->sys->setDistribution(trim($buf));
$list = @parse_ini_file(PSI_APP_ROOT."/data/distros.ini", 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 pci
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function pci()
{
if ((!$results = Parser::lspci(false)) && (!$results = $this->pciconf())) {
foreach ($this->readdmesg() as $line) {
if (preg_match($this->_PCIRegExp1, $line, $ar_buf)) {
- 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 _filesystems
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _filesystems()
{
$df_args = "";
$hideFstypes = array();
if (defined('PSI_HIDE_FS_TYPES') && is_string(PSI_HIDE_FS_TYPES)) {
- 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 _hostname
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
- 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 _hostname
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
- 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 _hostname
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
- 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 _copyFile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function _copyFile($chmod) {
$matched = array();
if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
return false;
}
- 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 XoopsInfo_GetLastVersion
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function XoopsInfo_GetLastVersion()
{
global $modversion;
$version = @file_get_contents($modversion['status_fileinfo']);
- 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 access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Method get_mimetypes
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function get_mimetypes($limit=20, $start=0, $status=-1, $OtherCriteria=null, $sort='mime_ext', $order='ASC', $asobject=true) {
Function refreshHardware
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function refreshHardware(xml) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
$("#hardware").remove();
return;
}
- 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 deeply nested control flow statements. Open
if (bytes > Math.pow(1024, 2)) {
show += round(bytes / Math.pow(1024, 2), 2);
show += String.fromCharCode(160) + genlang(88);
} else {
if (bytes > Math.pow(1024, 1)) {
Function setMatcher
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
Avoid deeply nested control flow statements. Open
if (bps > Math.pow(1000, 1)) {
show += round(bps / Math.pow(1000, 1), 2);
show += String.fromCharCode(160) + 'Kb/s';
} else {
show += bps;
Function renderOther
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function renderOther(data) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('other', blocks) < 0))) {
$("#block_other").remove();
return;
}
- 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 deeply nested control flow statements. Open
if (bytes > Math.pow(1000, 2)) {
show += round(bytes / Math.pow(1000, 2), 2);
show += " " + genlang(40);
} else {
if (bytes > Math.pow(1000, 1)) {
Function on
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function on( elem, types, selector, data, fn, one ) {
Function getLanguage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getLanguage(plugin, langarrId) {
var getLangUrl = "";
if (current_language) {
getLangUrl = 'language/language.php?lang=' + current_language;
if (plugin) {
- 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 deeply nested control flow statements. Open
if (bps > Math.pow(1000, 1)) {
show += round(bps / Math.pow(1000, 1), 2);
show += String.fromCharCode(160) + 'Kb/s';
} else {
show += bps;
Avoid deeply nested control flow statements. Open
if (bytes > Math.pow(1000, 2)) {
show += round(bytes / Math.pow(1000, 2), 2);
show += String.fromCharCode(160) + genlang(40);
} else {
if (bytes > Math.pow(1000, 1)) {