Showing 573 of 5,122 total issues
Function format
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo, init) {
var time,
$table = c.$table,
saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
sortList = { 'sortList' : c.sortList },
Method adslight_show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function adslight_show($options)
{
if (!class_exists(Helper::class)) {
return [];
}
Function xcopy
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function xcopy($source, $dest): bool
{
// Check for symlinks
if (\is_link($source)) {
return \symlink(\readlink($source), $dest);
- 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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function render(?array $block = null): void
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
- 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 getTotalItems
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getTotalItems($sel_id, $status = ''): int
{
global $xoopsDB, $mytree;
$categories = self::getMyItemIds('adslight_view');
$count = 0;
- 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 resizeImage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeImage(
$img,
$thumbwidth,
$thumbheight,
$pictwidth,
Method orderBlock
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function orderBlock(
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
Method delReply
has 35 lines of code (exceeds 25 allowed). Consider refactoring. 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(
Function setOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
Function getWidthOrHeight
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getWidthOrHeight( elem, dimension, extra ) {
// Start with computed style
var styles = getStyles( elem ),
Function handlers
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
handlers: function( event, handlers ) {
var i, handleObj, sel, matchedHandlers, matchedSelectors,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
Function setHandlePosition
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHandlePosition : function( c, wo ) {
var startPosition,
tableHeight = c.$table.height(),
$handles = wo.$resizable_container.children(),
handleCenter = Math.floor( $handles.width() / 2 );
Function setHandlePosition
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHandlePosition : function( c, wo ) {
var startPosition,
tableHeight = c.$table.height(),
$handles = wo.$resizable_container.children(),
handleCenter = Math.floor( $handles.width() / 2 );
Method tips_writing
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tips_writing(): void
{
global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsTpl, $myts, $mytree, $meta, $mid, $prem_perm;
$helper = Helper::getInstance();
$GLOBALS['xoopsOption']['template_main'] = 'adslight_tips_writing_ad.tpl';
Consider simplifying this complex logical expression. Open
} else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
Consider simplifying this complex logical expression. Open
if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
// this test for regex has potential to slow down the overall search
!tsfRegex.regex.test( data.filter ) ) {
var indx, filterMatched, query, regex,
// duplicate data but split filter
Consider simplifying this complex logical expression. Open
} else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
Consider simplifying this complex logical expression. Open
if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
// this test for regex has potential to slow down the overall search
!tsfRegex.regex.test( data.filter ) ) {
var indx, filterMatched, query, regex,
// duplicate data but split filter
Function showHide
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showHide( elements, show ) {
var display, elem,
values = [],
index = 0,
length = elements.length;
Method getAllPictures
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllPictures(
$criteria = [],
$asobject = false,
$sort = 'cod_img',
$cat_order = 'ASC',