Showing 149 of 528 total issues
Function populate_bvc_data
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def populate_bvc_data(
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Avoid deeply nested control flow statements. Open
Open
if ( copyIsArray && !Array.isArray( src ) ) {
clone = [];
} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
clone = {};
} else {
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 ( attrs[ i ] ) {
name = attrs[ i ].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = camelCase( name.slice( 5 ) );
dataAttr( elem, name, data[ name ] );
Avoid deeply nested control flow statements. Open
Open
if ( hasScripts ) {
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( scripts, getAll( node, "script" ) );
Function on
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function on( elem, types, selector, data, fn, one ) {
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
if ( nodeType === 9 ) {
if ( ( elem = context.getElementById( m ) ) ) {
// Support: IE, Opera, Webkit
// TODO: identify versions
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 ( isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
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 ( ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) &&
++diff ) {
Avoid deeply nested control flow statements. Open
Open
if ( newContext !== context || !support.scope ) {
// Capture the context ID, setting it first if necessary
if ( ( nid = context.getAttribute( "id" ) ) ) {
nid = nid.replace( rcssescape, fcssescape );
Function get_or_create_user
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_or_create_user(request):
userid = responses.get_userid(request)
if userid:
user, _ = User.objects.get_or_create(id=userid)
- 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
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
Function generate_bvc_stats
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def generate_bvc_stats(survey, team_name_list, archive_date, num_iterations=0):
# Generate Stats for Team Temp Average for gauge and wordcloud - look here for Gauge and Word Cloud
# BVC.html uses stats.count and stats.average.score__avg and cached word
# cloud uses stats.words below
- 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
} else if ( match[ 2 ] ) {
push.apply( results, context.getElementsByTagName( selector ) );
return results;
// Class selector
Avoid deeply nested control flow statements. Open
Open
if ( node && node.value === id ) {
return [ elem ];
}
Avoid deeply nested control flow statements. Open
Open
if ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) {
return false;