Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
Open
if line_key.lower() == test_key:
keys_match = True
else:
Avoid deeply nested control flow statements. Open
Open
if (d['VPCId'] == vpc_id
and d['VPCRegion'] == vpc_region):
create = False
break
else:
Avoid deeply nested control flow statements. Open
Open
for perm in win_perms[user]['perms']:
if not salt.utils.win_dacl.has_permission(
name, user, perm, exact=False):
grant_perms.append(win_perms[user]['perms'])
if grant_perms:
Avoid deeply nested control flow statements. Open
Open
if 'grant_perms' not in changes:
changes['grant_perms'] = {}
if user not in changes['grant_perms']:
Avoid deeply nested control flow statements. Open
Open
if value_ignore_case:
line_value = line_value.lower()
test_value = test_value.lower()
# values match if they are equal at this point
Avoid deeply nested control flow statements. Open
Open
if not salt.utils.win_dacl.has_permission(
name, user, win_deny_perms[user]['perms'], 'deny'):
deny_perms = win_deny_perms[user]['perms']
else:
Avoid deeply nested control flow statements. Open
Open
if group is not None and group != stats.get('group'):
fchange['group'] = group
if mode is not None and mode != stats.get('mode'):
Avoid deeply nested control flow statements. Open
Open
if 'deleted' not in ret['changes'].keys():
ret['changes'] = {'deleted': []}
ret['changes']['deleted'].append(val)
Function _compute_diff
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _compute_diff(configured, expected):
'''Computes the differences between the actual config and the expected config'''
diff = {
- 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 'deny' in perms[user_name] and not perms[user_name]['deny']['inherited']:
if 'remove_perms' not in changes:
changes['remove_perms'] = {}
changes['remove_perms'].update({user_name: perms[user_name]})
Avoid deeply nested control flow statements. Open
Open
if salt.utils.platform.is_windows():
ret = __salt__['file.check_perms'](
path=full,
ret=ret,
owner=win_owner,
Avoid deeply nested control flow statements. Open
Open
if 'grant' in perms[user]:
if not perms[user]['grant']['applies to'] == applies_to_text:
if 'grant_perms' not in changes:
changes['grant_perms'] = {}
if user not in changes['grant_perms']:
Avoid deeply nested control flow statements. Open
Open
if 'deny' in perms[user]:
if not perms[user]['deny']['applies to'] == applies_to_text:
if 'deny_perms' not in changes:
changes['deny_perms'] = {}
if user not in changes['deny_perms']:
Avoid deeply nested control flow statements. Open
Open
if 'deleted' not in ret['changes'].keys():
ret['changes'] = {'deleted': []}
ret['changes']['deleted'].append(val)
Function not_cached
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def not_cached(name, saltenv='base'):
'''
.. versionadded:: 2017.7.3
Ensures that a file is not present in the minion's cache, deleting it
- 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 user not in changes['grant_perms']:
changes['grant_perms'][user] = {}
changes['grant_perms'][user]['perms'] = grant_perms
Avoid deeply nested control flow statements. Open
Open
if mode is not None and mode != stats.get('mode'):
fchange['mode'] = mode
if fchange:
Avoid deeply nested control flow statements. Open
Open
if salt.utils.platform.is_windows():
ret['comment'] += (
'Failed to set ownership of symlink '
'{0} to {1}'.format(name, win_owner))
else:
Avoid deeply nested control flow statements. Open
Open
if fchange:
changes[path] = fchange
if check_dirs:
Avoid deeply nested control flow statements. Open
Open
if diff_count[key] > 0:
diff_count[key] -= 1
# at this point a continue saves going through the rest of
# the keys to see if they match since this line already
#matched the current key