Showing 573 of 5,122 total issues
Function changeImage
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Lightbox.prototype.changeImage = function(imageNumber) {
var self = this;
var filename = this.album[imageNumber].link;
var filetype = filename.split('.').slice(-1)[0];
var $image = this.$lightbox.find('.lb-image');
Function changeImage
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Lightbox.prototype.changeImage = function(imageNumber) {
var self = this;
var filename = this.album[imageNumber].link;
var filetype = filename.split('.').slice(-1)[0];
var $image = this.$lightbox.find('.lb-image');
Function multisort
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
multisort : function( c ) { /*jshint loopfunc:true */
var tbodyIndex, sortTime, colMax, rows, tmp,
table = c.table,
sorter = [],
dir = 0,
Function multisort
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
multisort : function( c ) { /*jshint loopfunc:true */
var tbodyIndex, sortTime, colMax, rows, tmp,
table = c.table,
sorter = [],
dir = 0,
Function index
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function index(): void
{
global $xoopsDB, $myts, $admin_lang;
// require_once __DIR__ . '/admin_header.php';
xoops_cp_header();
- 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 deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory(string $src): bool
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
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 getAllPictures
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getAllPictures(
$criteria = [],
$asobject = false,
$sort = 'cod_img',
$cat_order = 'ASC',
- 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 domManip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function domManip( collection, args, callback, ignored ) {
// Flatten any nested arrays
args = concat.apply( [], args );
Function addRows
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
addRows : function( c, $row, resort, callback ) {
var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
cacheIndex, rowData, cells, cell, span,
// allow passing a row string if only one non-info tbody exists in the table
valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
Function addRows
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
addRows : function( c, $row, resort, callback ) {
var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
cacheIndex, rowData, cells, cell, span,
// allow passing a row string if only one non-info tbody exists in the table
valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
Method __construct
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($target)
{
$this->helper = $target->helper;
$this->targetObject = $target;
Method modifyAds
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
$lid,
$cat,
$title,
$status,
$expire,
Function ajaxConvert
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
Function getFilters
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
var i, $filters, $column, cols,
filters = [],
c = table ? $( table )[0].config : '',
wo = c ? c.widgetOptions : '';
Function getFilters
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
var i, $filters, $column, cols,
filters = [],
c = table ? $( table )[0].config : '',
wo = c ? c.widgetOptions : '';
Consider simplifying this complex logical expression. Open
if ( table.config.widgetOptions.filter_initialized &&
// immediate search if user presses enter
( event.which === tskeyCodes.enter ||
// immediate search if a "search" or "blur" is triggered on the input
( eventType === 'search' || eventType === 'blur' ) ||
Consider simplifying this complex logical expression. Open
if ( table.config.widgetOptions.filter_initialized &&
// immediate search if user presses enter
( event.which === tskeyCodes.enter ||
// immediate search if a "search" or "blur" is triggered on the input
( eventType === 'search' || eventType === 'blur' ) ||
Function storage
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
ts.storage = function(table, key, value, options) {
table = $(table)[0];
var cookieIndex, cookies, date,
hasStorage = false,
values = {},
Function storage
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
ts.storage = function(table, key, value, options) {
table = $(table)[0];
var cookieIndex, cookies, date,
hasStorage = false,
values = {},
Function bindings
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindings : function( c, wo ) {
var namespace = c.namespace + 'tsresize';
wo.$resizable_container.children().bind( 'mousedown', function( event ) {
// save header cell and mouse position
var column,