Showing 573 of 5,122 total issues
Avoid deeply nested control flow statements. Open
if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
// determine column max value (ignore sign)
colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
}
Function xoops_module_install_adslight
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_adslight(\XoopsModule $module): bool
{
require_once \dirname(__DIR__, 3) . '/mainfile.php';
global $xoopsDB;
- 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 ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
}
Avoid deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Function sortNumericAsc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
sortNumericAsc : function( a, b, num, max, col, c ) {
Function sortNumericDesc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
sortNumericDesc : function( a, b, num, max, col, c ) {
Avoid deeply nested control flow statements. Open
if ( !$sorted[ column ].sortDisabled ) {
updateColumnSort( $sorted.eq( column ), list[ indx ][ 1 ] );
}
Avoid deeply nested control flow statements. Open
for ( indx = 1; indx < th.colSpan; indx++ ) {
c.sortList[ c.sortList.length ] = [ col + indx, dir ];
// update count on columns in colSpan
c.sortVars[ col + indx ].count = $.inArray( dir, order );
c.sortVars[ col + indx ].sortedBy = sortedBy;
Avoid deeply nested control flow statements. Open
if ( span > 0 ) {
index = 0;
while ( index <= span ) {
// duplicate text (or not) to spanned columns
// instead of setting duplicate span to empty string, use textExtraction to try to get a value
Avoid deeply nested control flow statements. Open
if ( temp ) {
tmp = c.sortList[ 0 ][ 1 ];
switch ( temp[ 0 ] ) {
case 'd' :
dir = 1;
Avoid deeply nested control flow statements. Open
if ( tmp[1] === 2 ) {
c.sortList.splice( indx, 1 );
c.sortVars[ col ].count = -1;
}
Avoid deeply nested control flow statements. Open
if ( noParser ) {
parser = ts.getParserById( 'no-parser' );
}
Method getAllPictures
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$criteria = [],
$asobject = false,
$sort = 'cod_img',
$cat_order = 'ASC',
$limit = 0,
Function convertOrderByOut
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function convertOrderByOut($orderby): string
{
if ('title ASC' === $orderby) {
$orderby = 'titleA';
}
- 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 getFileStatus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
{
global $pathIcon16;
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
- 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
Method makeAdSelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeAdSelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
Avoid deeply nested control flow statements. Open
if ($photo) {
$a_item['photo'] = '<img src="' . XOOPS_URL . "/modules/adslight/assets/images/camera_photo.png\" align=\"left\" width=\"24\" alt=\"{$title}\">";
}
Avoid deeply nested control flow statements. Open
if ($chcount > $helper->getConfig('adslight_nbsouscat')) {
$subcategories .= "<a href=\"viewcats.php?cid={$myrow['cid']}\">" . _ADSLIGHT_CATPLUS . '</a>';
break;
}
Avoid deeply nested control flow statements. Open
if (is_file("{$destination}/{$purl}")) {
unlink("{$destination}/{$purl}");
}
Avoid deeply nested control flow statements. Open
if (is_file("{$destination2}/thumb_{$purl}")) {
unlink("{$destination2}/thumb_{$purl}");
}