Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
if init_file in subfiles:
break
else:
Avoid deeply nested control flow statements. Open
if _get_volume(volume, array) is not None:
try:
array.set_pgroup(name, addvollist=[volume])
return True
except purestorage.PureError:
Function do_checkout
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def do_checkout(self, repo):
'''
Common code for git_pillar/winrepo to handle locking and checking out
of a repo.
'''
- 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 file_hash
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def file_hash(self, load, fnd):
'''
Return a file hash, the hash type is set in the master config file
'''
if 'env' in load:
- 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 salt.utils.stringutils.expr_match(key, block):
del ret[key]
log.trace('Filtering %s grain', key)
if not ret:
Avoid deeply nested control flow statements. Open
if temp['vol'] == volume:
try:
array.disconnect_hgroup(name, volume)
return True
except purestorage.PureError:
Avoid deeply nested control flow statements. Open
if _get_hgroup(hostgroup, array) is not None:
try:
array.set_pgroup(name, addhgrouplist=[hostgroup])
return True
except purestorage.PureError:
Avoid deeply nested control flow statements. Open
if not os.path.isfile(key_path):
_key_does_not_exist(key_type, key_path)
except TypeError:
Avoid deeply nested control flow statements. Open
if sys.getsizeof(data[key]) > max_val_size:
data[key] = replace_with
percent = percent - stepper_size
Avoid deeply nested control flow statements. Open
if not event['data']['fun'] in funs:
publish = False
if publish:
Function missing_fun_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def missing_fun_string(self, function_name):
'''
Return the error string for a missing function.
This can range from "not available' to "__virtual__" returned False
- 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 saltenv == 'base':
# Remove redundant 'ref' config for base saltenv
repo_obj.saltenv[saltenv].pop('ref')
if ref != repo_obj.base:
log.warning(
Avoid deeply nested control flow statements. Open
if salt.utils.stringutils.expr_match(key, block):
del ret[key]
log.trace('Filtering %s grain', key)
if not ret:
Function volume_extend
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def volume_extend(name, size):
'''
Extend an existing volume on a Pure Storage FlashArray.
- 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 salt.utils.platform.is_windows() \
and not ldest.startswith('\\\\') \
and os.path.isdir(ldest):
# On Windows, symlinks to directories
# must be removed as if they were
Avoid deeply nested control flow statements. Open
if _get_host(host, array) is not None:
try:
array.set_pgroup(name, addhostlist=[host])
return True
except purestorage.PureError:
Function start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start(address=None, port=5000, ssl_crt=None, ssl_key=None):
'''
Api to listen for webhooks to send to the reactor.
Implement the webhook behavior in an engine.
- 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 _trim_dict_in_dict
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _trim_dict_in_dict(data, max_val_size, replace_with):
'''
Takes a dictionary, max_val_size and replace_with
and recursively loops through and replaces any values
that are greater than max_val_size.
- 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 _get_sqs_conn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_sqs_conn(profile, region=None, key=None, keyid=None):
'''
Get a boto connection to SQS.
'''
if profile:
- 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 _process_queue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _process_queue(q, q_name, fire_master, tag='salt/engine/sqs', owner_acct_id=None, message_format=None):
if not q:
log.warning(
'failure connecting to queue: %s, waiting 10 seconds.',
':'.join([_f for _f in (six.text_type(owner_acct_id), q_name) if _f])
- 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"