Showing 573 of 5,122 total issues
Avoid deeply nested control flow statements. Open
Open
if (\is_file("{$destination}/{$url}")) {
\unlink("{$destination}/{$url}");
}
Avoid deeply nested control flow statements. Open
Open
if (\is_file("{$destination2}/thumb_{$url}")) {
\unlink("{$destination2}/thumb_{$url}");
}
Avoid deeply nested control flow statements. Open
Open
if (\is_file("{$destination3}/resized_{$url}")) {
\unlink("{$destination3}/resized_{$url}");
}
Avoid deeply nested control flow statements. Open
Open
if ($GLOBALS['xoopsUser']->isAdmin()) {
$a_item['admin'] = '<a href="' . XOOPS_URL . "/modules/adslight/admin/validate_ads.php?op=modifyAds&lid={$lid}\"><img src=\"{$pathIcon16}/edit.png\" border=\"0\" alt=\"" . _ADSLIGHT_MODADMIN . '"></a>';
}
Function convertOrderByTrans
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function convertOrderByTrans($orderby): string
{
$orderbyTrans = '';
if ('hits ASC' === $orderby) {
$orderbyTrans = \_ADSLIGHT_POPULARITYLTOM;
- 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 delReply
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function delReply($r_lid, $ok): void
{
global $xoopsDB;
$helper = Helper::getInstance();
$sql = 'SELECT l.usid, r.r_lid, r.lid, r.title, r.date_created, r.submitter, r.message, r.tele, r.email, r.r_usid FROM ' . $xoopsDB->prefix(
- 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 makeMySelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
Avoid deeply nested control flow statements. Open
Open
if ($space > 0) {
$subcategories .= '<br>';
}
Avoid deeply nested control flow statements. Open
Open
if ($photo) {
$a_item['photo'] = '<a href="' . XOOPS_URL . "/modules/adslight/viewads.php?lid={$lid}\"><img class=\"thumb\" src=\"{$updir}/thumbs/thumb_{$url}\" align=\"left\" width=\"100px\" alt=\"{$title}\"></a>";
}
Method resizeImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$img,
$thumbwidth,
$thumbheight,
$pictwidth,
$pictheight,
Avoid deeply nested control flow statements. Open
Open
if (is_file("{$destination3}/resized_{$purl}")) {
unlink("{$destination3}/resized_{$purl}");
}
Consider simplifying this complex logical expression. Open
Open
if ( support.qsa &&
!nonnativeSelectorCache[ selector + " " ] &&
(!rbuggyQSA || !rbuggyQSA.test( selector )) &&
// Support: IE 8 only
Consider simplifying this complex logical expression. Open
Open
if ( tsfRegex.andTest.test( data.filter ) ) {
var indx, filterMatched, result, query, regex,
// duplicate data but split filter
data2 = $.extend( {}, data ),
filter = data.filter.split( tsfRegex.andSplit ),
Consider simplifying this complex logical expression. Open
Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
if ( !context ) {
Consider simplifying this complex logical expression. Open
Open
if ( tsfRegex.toTest.test( data.iFilter ) ) {
var result, tmp, range1, range2,
table = c.table,
index = data.index,
parsed = data.parsed[index],
Consider simplifying this complex logical expression. Open
Open
if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
typeof filters[c.columns] !== 'undefined' ) {
data.anyMatchFlag = true;
data.anyMatchFilter = '' + (
filters[ c.columns ] ||
Consider simplifying this complex logical expression. Open
Open
if ( $header && $header.length ) {
// $filter = c.$filters.filter( '[data-column="' + column + '"]' );
$filter = tsf.getColumnElm( c, c.$filters, column );
ffxn = ts.getColumnData( table, wo.filter_functions, column );
makeSelect = ( wo.filter_functions && ffxn && typeof ffxn !== 'function' ) ||
Consider simplifying this complex logical expression. Open
Open
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
Consider simplifying this complex logical expression. Open
Open
if ( ( !support.boxSizingReliable() && isBorderBox ||
val === "auto" ||
!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
elem.getClientRects().length ) {
Consider simplifying this complex logical expression. Open
Open
if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
typeof filters[c.columns] !== 'undefined' ) {
data.anyMatchFlag = true;
data.anyMatchFilter = '' + (
filters[ c.columns ] ||