Showing 551 of 2,707 total issues
Avoid deeply nested control flow statements. Open
Open
if ( !status && options.isLocal && !options.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 ( 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 ( xhr.readyState !== 4 ) {
xhr.abort();
}
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
if ( !selector ) {
push.apply( results, seed );
return results;
}
Avoid deeply nested control flow statements. Open
Open
if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
}
Function setMatcher
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
Avoid deeply nested control flow statements. Open
Open
if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
for ( var fn in timers[label] ) {
window.clearInterval(timers[label][fn]);
delete timers[label][fn];
}
Avoid deeply nested control flow statements. Open
Open
if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
// Cache the index of each encountered element
if ( useCache ) {
(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
}
Avoid deeply nested control flow statements. Open
Open
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
Avoid deeply nested control flow statements. Open
Open
if ( fn.$timerID ) {
window.clearInterval(timers[label][fn.$timerID]);
delete timers[label][fn.$timerID];
}
Function process_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def process_request(self, request):
if not hasattr(request, 'user') or not hasattr(request, 'session'):
return
real_user = request.user
impersonated_id = self.get_impersonation(request)
- 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
Avoid deeply nested control flow statements. Open
Open
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
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 ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
return false;
}
Avoid deeply nested control flow statements. Open
Open
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
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) );
}
Function add_user_no_matter_what
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_user_no_matter_what(username, first_name, last_name, email, password, cookie):