Showing 371 of 658 total issues
Avoid deeply nested control flow statements. Open
Open
if ( cache[1] === true ) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
Avoid deeply nested control flow statements. Open
Open
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
Avoid deeply nested control flow statements. Open
Open
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
Avoid deeply nested control flow statements. Open
Open
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
Avoid deeply nested control flow statements. Open
Open
if ( hasScripts ) {
jQuery.merge( scripts, getAll( node, "script" ) );
}
Avoid deeply nested control flow statements. Open
Open
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split(" ");
if ( tmp[ 1 ] === current ) {
Avoid deeply nested control flow statements. Open
Open
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
Avoid deeply nested control flow statements. Open
Open
if ( matches[ sel ] === undefined ) {
matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
Avoid deeply nested control flow statements. Open
Open
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
Avoid deeply nested control flow statements. Open
Open
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Function setMatcher
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
Function init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
init: function( elem, options, prop, end, easing, unit ) {
Avoid deeply nested control flow statements. Open
Open
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
Avoid deeply nested control flow statements. Open
Open
if ( conv && s["throws"] ) {
response = conv( response );
} else {
try {
response = conv( response );
Avoid deeply nested control flow statements. Open
Open
if (this.second <= this._defaults.secondMin) {
this.second = this._defaults.secondMin;
this._defaults.millisecMin = minDateTime.getMilliseconds();
} else {
if (this.millisec < this._defaults.millisecMin) {
Avoid deeply nested control flow statements. Open
Open
if (this.second >= this._defaults.secondMax) {
this.second = this._defaults.secondMax;
this._defaults.millisecMax = maxDateTime.getMilliseconds();
} else {
if (this.millisec > this._defaults.millisecMax) {
Avoid deeply nested control flow statements. Open
Open
if (overrides.hasOwnProperty(prop) && name[prop]) {
fns[prop] = name[prop];
}
Method generate_pick_none_input_html
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def generate_pick_none_input_html(value, default_value, css_class, response_class, disabled, input_mask, input_mask_placeholder)
html = {}
html[:class] = [response_class,css_class].reject{ |c| c.blank? }
html[:value] = value.blank? ? default_value : value
html[:disabled] = disabled unless disabled.blank?
- 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"