Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
Open
if user not in changes['deny_perms']:
changes['deny_perms'][user] = {}
changes['deny_perms'][user]['perms'] = deny_perms
Avoid deeply nested control flow statements. Open
Open
if __opts__['test']:
ret['comment'] += 'Cluster {0} is set to set up\n'.format(pcsclustername)
Avoid deeply nested control flow statements. Open
Open
for perm in win_deny_perms[user]['perms']:
if not salt.utils.win_dacl.has_permission(
name, user, perm, 'deny', exact=False):
deny_perms.append(win_deny_perms[user]['perms'])
if deny_perms:
Avoid deeply nested control flow statements. Open
Open
if not values_match or needs_changing:
# the old line always needs to go, so that will be
# reflected in the diff (this is the original line from
# the file being read)
diff.append('- {0}'.format(line))
Avoid deeply nested control flow statements. Open
Open
if 'grant' in perms[user_name] and not perms[user_name]['grant']['inherited']:
if 'remove_perms' not in changes:
changes['remove_perms'] = {}
changes['remove_perms'].update({user_name: perms[user_name]})
if user_name not in win_deny_perms:
Avoid deeply nested control flow statements. Open
Open
for key in right:
right[key] = six.text_type(right[key])
if sorted(kwargs['rights']) != sorted(usergroup['rights']):
Avoid deeply nested control flow statements. Open
Open
if mdir.startswith(link, 0):
log.debug(
'** skipping empty dir ** %s, it intersects a '
'symlink', mdir
)
Avoid deeply nested control flow statements. Open
Open
if not salt.utils.win_dacl.has_permission(
name, user, win_perms[user]['perms']):
grant_perms = win_perms[user]['perms']
else:
Avoid deeply nested control flow statements. Open
Open
if os.path.isdir(fn):
if _is_child(fn, name):
if fun == 'recurse':
fkeep = _gen_recurse_managed_files(**low)[3]
log.debug('Keep from %s: %s', fn, fkeep)
Avoid deeply nested control flow statements. Open
Open
if salt.utils.platform.is_windows():
ret['comment'] = ('Set ownership of symlink {0} to '
'{1}'.format(name, win_owner))
ret['changes']['ownership'] = win_owner
else:
Avoid deeply nested control flow statements. Open
Open
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 did_uncomment:
# irrespective of a value, if it was commented out and
# changes are still to be made, then it needs to be
# commented in
if diff_count[key] > 0:
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 user is not None and user != stats.get('user'):
fchange['user'] = user
if group is not None and group != stats.get('group'):
Avoid deeply nested control flow statements. Open
Open
if fchange:
changes[path] = fchange
# Recurse skips root (we always do dirs, not root), so always check root:
if not children_only:
Avoid deeply nested control flow statements. Open
Open
if not exc.strerror.startswith('Path not found'):
errors.append(exc.strerror)
Avoid deeply nested control flow statements. Open
Open
for acl_name in acl_names:
__salt__['acl.modfacl'](acl_type, acl_name, perms, name,
recursive=recurse, raise_err=True)
ret.update({'comment': 'Applied new permissions for '
Avoid deeply nested control flow statements. Open
Open
if result.get('stderr'):
comments.append(result['stderr'])
ret['comment'] = '\n'.join(comments)
Function present
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def present(name,
path,
mask,
cmd,
user='root'):
- 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 deploy_resources
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def deploy_resources(self, ret, api_key_required, lambda_integration_role, lambda_region, authorization_type):
'''
Method to deploy resources defined in the swagger file.
ret
- 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"