Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
with salt.utils.files.fopen(pubfn_denied, 'w+') as fp_:
fp_.write(load['pub'])
eload = {'result': False,
Avoid deeply nested control flow statements. Open
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
Avoid deeply nested control flow statements. Open
if ( elem && elem.parentNode ) {
// Handle the case where IE, Opera, and Webkit return items
// by name instead of ID
if ( elem.id === m ) {
results.push( elem );
Avoid deeply nested control flow statements. Open
if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
return false;
}
Avoid deeply nested control flow statements. Open
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
Avoid deeply nested control flow statements. Open
if tcp_keepalive_intvl > 0:
sock.setsockopt(
socket.SOL_TCP, socket.TCP_KEEPINTVL,
int(tcp_keepalive_intvl))
if hasattr(socket, 'SIO_KEEPALIVE_VALS'):
Function _internal_send_recv
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _internal_send_recv(self):
while self.send_queue:
message = self.send_queue[0]
future = self.send_future_map.get(message, None)
if future is None:
- 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 hash_and_stat_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def hash_and_stat_file(self, path, saltenv='base'):
'''
The same as hash_file, but also return the file's mode, or None if no
mode data is present.
'''
- 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
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
if line.startswith('pbr='):
session.install(
'--progress-bar=off',
line.split()[0].strip(),
silent=PIP_INSTALL_SILENT)
Function factory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def factory(cls, opts, **kwargs):
# Default to ZeroMQ for now
ttype = 'zeromq'
# determine the ttype
- 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
if ( rscriptType.test( node.type || "" ) &&
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Hope ajax is available...
Avoid deeply nested control flow statements. Open
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
Avoid deeply nested control flow statements. Open
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
Avoid deeply nested control flow statements. Open
if stamp is True:
item['time'] = event['data']['_stamp']
__reg__[name]['val'].append(item)
Avoid deeply nested control flow statements. 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
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Avoid deeply nested control flow statements. Open
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
Avoid deeply nested control flow statements. Open
if ( hasScripts ) {
jQuery.merge( scripts, getAll( node, "script" ) );
}
Avoid deeply nested control flow statements. Open
with salt.utils.files.fopen(pubfn_denied, 'w+') as fp_:
fp_.write(load['pub'])
eload = {'result': False,