Showing 1,065 of 16,781 total issues
Function _pci
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _pci()
{
if (CommonFunctions::executeProgram('lspci', '', $bufr, false)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $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 _network
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _network()
{
if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
- 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 _fillDevice
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)
{
$mount->addAttribute('MountPointID', $i);
if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());
$mount->addAttribute('Name', $dev->getName());
- 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 _getTemplateList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _getTemplateList()
{
$dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/templates/');
sort($dirlist);
foreach ($dirlist as $file) {
- 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 delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function delete(&$mimetype_object, $force = false) {
if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes') {
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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
if (defined('PSI_PLUGIN_PINGTEST_ADDRESSES') && is_string(PSI_PLUGIN_PINGTEST_ADDRESSES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PINGTEST_ADDRESSES)) {
$addresses = eval(PSI_PLUGIN_PINGTEST_ADDRESSES);
- 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 allowedMimeTypes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function allowedMimeTypes( $mid, $groups, $allowedMimeTypes ) {
$ret = array();
$sql = 'SELECT p.mperm_groups, t.mime_ext, t.mime_types FROM ' . $this->db->prefix('mimetypes_perms') . ' p LEFT JOIN ' .
$this->db->prefix("mimetypes") . ' t on p.mperm_mime = t.mime_id WHERE mperm_module=' . $mid;
- 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 getErrors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function &getErrors($ashtml = true) {
if (!$ashtml) {
return $this->errors;
} else {
$ret = '';
- 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 runTests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function runTests()
{
// initialize a bunch of arrays
$this->test_results = [];
- 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 _outputRenderStatsTable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _outputRenderStatsTable()
{
// Add by
// https://github.com/bigdeej/PhpSecInfo/tree/master/PhpSecInfo/Test/Core
$score = 100;
- 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 function. Open
return sortInput ?
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
Avoid too many return
statements within this function. Open
return select( selector.replace( rtrim, "$1" ), context, results, seed );
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return compare & 4 ? -1 : 1;
Avoid too many return
statements within this function. Open
return this.constructor( context ).find( selector );
Avoid too many return
statements within this function. Open
return key === undefined || hasOwn.call( obj, key );
Avoid too many return
statements within this function. Open
return results;
Avoid too many return
statements within this function. Open
return results;
Avoid too many return
statements within this function. Open
return jQuery.makeArray( selector, this );
Avoid too many return
statements within this function. Open
return 'numeric';