Showing 573 of 5,122 total issues
Consider simplifying this complex logical expression. Open
if ( searchFiltered ) {
// cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
for ( indx = 0; indx < columnIndex + 1; indx++ ) {
val = filters[indx] || '';
// break out of loop if we've already determined not to search filtered rows
Consider simplifying this complex logical expression. Open
if ( searchFiltered ) {
// cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
for ( indx = 0; indx < columnIndex + 1; indx++ ) {
val = filters[indx] || '';
// break out of loop if we've already determined not to search filtered rows
File add.php
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
File search.php
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
Function updateBlock
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
{
$myblock = new \XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
- 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 getMoneyFormat
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function getMoneyFormat(
$format,
$number
) {
$regex = '/%((?:[\^!\-]|\+|\(|\=.)*)(\d+)?' . '(?:#(\d+))?(?:\.(\d+))?([in%])/';
- 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 checkVerModule
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerModule(Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$update = '';
- 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 orderBlock
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function orderBlock(
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
- 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 add
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function matcherFromGroupMatchers
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
Function buildSelect
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildSelect: function( table, column, arry, updating, onlyAvail ) {
table = $( table )[0];
column = parseInt( column, 10 );
if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
return;
Function buildSelect
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildSelect: function( table, column, arry, updating, onlyAvail ) {
table = $( table )[0];
column = parseInt( column, 10 );
if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
return;
Function setHeadersCss
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadersCss : function( c ) {
var indx, column,
list = c.sortList,
len = list.length,
none = ts.css.sortNone + ' ' + c.cssNone,
Function setHeadersCss
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadersCss : function( c ) {
var indx, column,
list = c.sortList,
len = list.length,
none = ts.css.sortNone + ' ' + c.cssNone,
Function resolve
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolve( depth, deferred, handler, special ) {
return function() {
var that = this,
args = arguments,
mightThrow = function() {
Function bindSearch
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindSearch: function( table, $el, internal ) {
table = $( table )[0];
$el = $( $el ); // allow passing a selector string
if ( !$el.length ) { return; }
var tmp,
Function bindSearch
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindSearch: function( table, $el, internal ) {
table = $( table )[0];
$el = $( $el ); // allow passing a selector string
if ( !$el.length ) { return; }
var tmp,
Method index
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function index(): void
{
global $xoopsDB;
$helper = Helper::getInstance();
Function adsModCat
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function adsModCat($cid): void
{
global $xoopsDB, $myts;
$helper = Helper::getInstance();
$mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
- 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 build
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Lightbox.prototype.build = function() {
if ($('#lightbox').length > 0) {
return;
}