Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
Open
with salt.utils.files.fopen(cache_dest, 'wb+') as ofile:
ofile.write(data['data'])
if 'hsum' in data and d_tries < 3:
Avoid deeply nested control flow statements. Open
Open
if ( matches[ sel ] ) {
matches.push( handleObj );
}
Avoid deeply nested control flow statements. Open
Open
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if ( deleteExpando ) {
delete elem[ internalKey ];
} else if ( typeof elem.removeAttribute !== core_strundefined ) {
elem.removeAttribute( internalKey );
Avoid deeply nested control flow statements. Open
Open
if self.pillar_keys:
for key in self.pillar_keys:
if key in total['pillar']:
cache['pillar'][minion][key] = total['pillar'][key]
else:
Avoid deeply nested control flow statements. Open
Open
if self.opts.get('auth_events') is True:
self.event.fire_event(eload, salt.utils.event.tagify(prefix='auth'))
return {'enc': 'clear',
Avoid deeply nested control flow statements. Open
Open
if 'encoding' in field:
encoding = field.split('encoding=')[-1]
write_body[2] = encoding
Avoid deeply nested control flow statements. Open
Open
if self.grain_keys:
for key in self.grain_keys:
if key in total['grains']:
cache['grains'][minion][key] = total['grains'][key]
else:
Avoid deeply nested control flow statements. Open
Open
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
Function decode_dict_keys_to_str
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def decode_dict_keys_to_str(src):
'''
Convert top level keys from bytes to strings if possible.
This is necessary because Python 3 makes a distinction
between these types.
- 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 ( conv && s["throws"] ) {
response = conv( response );
} else {
try {
response = conv( response );
Avoid deeply nested control flow statements. Open
Open
if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
}
Avoid deeply nested control flow statements. Open
Open
if tcp_keepalive_intvl <= 0:
tcp_keepalive_intvl = 1
# The values expected are in milliseconds, so multiply by
# 1000.
sock.ioctl(socket.SIO_KEEPALIVE_VALS, (
Avoid deeply nested control flow statements. Open
Open
if this_password == __salt__['hashutil.digest'](password, hashtype):
return True
# Short circuit if we've already found the user but the password was wrong
return False
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 ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && context.parentNode || context
)) ) {
Avoid deeply nested control flow statements. Open
Open
while ( j-- ) {
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
elem.removeChild( tbody );
}
}
Avoid deeply nested control flow statements. Open
Open
if req.status_code == 200:
with open(fdest, 'wb') as wfh:
for chunk in req.iter_content(chunk_size=4096):
if chunk: # filter out keep-alive new chunks
wfh.write(chunk)
Function close
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def close(self):
'''
Since the message_client creates sockets and assigns them to the IOLoop we have to
specifically destroy them, since we aren't the only ones with references to the FDs
'''
- 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 self.opts.get('auth_events') is True:
self.event.fire_event(eload, salt.utils.event.tagify(prefix='auth'))
return {'enc': 'clear',