Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
Open
if new_member['name'] == member:
modified_member = new_member
break
#check for changes
Avoid deeply nested control flow statements. Open
Open
if 'scaling_policy' not in action:
scaling_policy_actions_only = False
if ':self:' in action:
Avoid deeply nested control flow statements. Open
Open
for line in key_file:
if line.startswith('#'):
# Commented line
continue
ssh_key = ssh_key + line
Avoid deeply nested control flow statements. Open
Open
if remove_instance:
# create remove_ array
if 'remove_{0}'.format(instance) not in vmconfig['changed']:
vmconfig['changed']['remove_{0}'.format(instance)] = []
Avoid deeply nested control flow statements. Open
Open
if ret['changes'].get('deleted_tags'):
comments.append(
'The following tags {0} removed from the local '
'checkout: {1}'.format(
'would be' if __opts__['test']
Avoid deeply nested control flow statements. Open
Open
if len(year) != 4:
year = time.strftime('%Y')[:2] + year
Function _write_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _write_config(config):
'''
writes /usbkey/config
'''
try:
- 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 'launch_config' not in ret['changes']:
ret['changes']['launch_config'] = {}
ret['changes']['launch_config']['deleted'] = asg['launch_config_name']
Avoid deeply nested control flow statements. Open
Open
if not msg:
msg = 'There was an error resetting a syslog config \'{0}\'.' \
'Please check debug logs.'.format(val)
ret['comment'] = 'Error: {0}'.format(msg)
Avoid deeply nested control flow statements. Open
Open
for config_env_var in val_config if isinstance(val_config, list) else json.loads(val_config):
config_env_var = config_env_var.split('=')
for img_env_var in val:
if img_env_var.startswith('{0}='.format(config_env_var[0])):
val.remove(img_env_var)
Avoid deeply nested control flow statements. Open
Open
while image:
image_count += 1
__salt__['imgadm.delete'](image['manifest']['uuid'])
if 'origin' in image['manifest']:
image = __salt__['imgadm.get'](image['manifest']['origin'])
Avoid deeply nested control flow statements. Open
Open
if collection in vmconfig['state'] and vmconfig['state'][collection] is not None:
if prop in vmconfig['state'][collection]:
continue
# create remove_ array
Avoid deeply nested control flow statements. Open
Open
if 'mac' in instance_config:
instance_config['mac'] = instance_config['mac'].lower()
vmconfig[prop].append(instance_config)
Avoid deeply nested control flow statements. Open
Open
if not revs_match and not update_head:
# Repo content would not be modified but the remote
# URL would be modified, so we can't just say that
# the repo is up-to-date, we need to inform the
# user of the actions taken.
Avoid deeply nested control flow statements. Open
Open
if vmconfig['current'][prop] == vmconfig['state'][prop]:
continue
else:
Avoid deeply nested control flow statements. Open
Open
if branch not in \
__salt__['git.list_branches'](
target,
user=user,
password=password,
Avoid deeply nested control flow statements. Open
Open
if 'launch_config' not in ret['changes']:
ret['changes']['launch_config'] = {}
ret['changes']['launch_config']['deleted'] = asg['launch_config_name']
Avoid deeply nested control flow statements. Open
Open
if rev in all_local_tags:
try:
local_tag_sha1 = __salt__['git.rev_parse'](
target,
rev + '^{commit}',
Avoid deeply nested control flow statements. Open
Open
if not revs_match:
if update_head:
if fast_forward is True:
actions.append(
'Repository would be fast-forwarded from '
Avoid deeply nested control flow statements. Open
Open
if ':self:' in action:
action = action.replace(':self:', ':{0}:'.format(name))
new_actions.append(action)