Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
Open
if not func(path_mode):
incorrect_type.append(path)
except OSError as exc:
Avoid deeply nested control flow statements. Open
Open
if not pipsearch:
pkg_404_comms.append(
'There was no error installing package \'{0}\' '
'although it does not show when calling '
'\'pip.freeze\'.'.format(pkg)
Avoid deeply nested control flow statements. Open
Open
if pre_comments != post_comments:
break
elif kwarg == 'comments' and __grains__['os_family'] in ('RedHat', 'VMware Photon'):
Avoid deeply nested control flow statements. Open
Open
if version is not None:
pkgs.append({chunk['name']: version})
else:
pkgs.append(chunk['name'])
chunk['__agg__'] = True
Avoid deeply nested control flow statements. Open
Open
if six.text_type(sanitizedkwargs[kwarg]) != six.text_type(pre[kwarg]):
break
else:
Avoid deeply nested control flow statements. Open
Open
if route_table_id:
route_table_found = True
route_table_desc = __salt__['boto_vpc.describe_route_table'](route_table_id=route_table_id,
region=region, key=key, keyid=keyid,
profile=profile)
Avoid deeply nested control flow statements. Open
Open
if 'a' in spec[1]:
include_alpha = True
if 'b' in spec[1]:
Avoid deeply nested control flow statements. Open
Open
for p in ('profile', 'key', 'keyid', 'region', 'wait_for_sync'):
cname[p] = locals().get(p) if p not in cname else cname[p]
_ret = __states__['boto_route53.present'](**cname)
Avoid deeply nested control flow statements. Open
Open
if 'tags' in lb:
if lb['tags']:
if tag in lb['tags']:
ret['changes']['old']['tags'][tag] = lb['tags'][tag]
if not tags_to_update and not tags_to_remove and not tags_to_add:
Function _alarms_present
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _alarms_present(name, alarms, alarms_from_pillar, region, key, keyid, profile):
'''helper method for present. ensure that cloudwatch_alarms are set'''
current = __salt__['config.option'](alarms_from_pillar, {})
if alarms:
current = salt.utils.dictupdate.update(current, alarms)
- 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 __grains__['os_family'] in ('RedHat', 'VMware Photon'):
if not salt.utils.data.is_true(sanitizedkwargs[kwarg]):
break
else:
break
Avoid deeply nested control flow statements. Open
Open
if _fulfills_version_spec(version, version_spec):
desired_version = version
break
else:
Avoid deeply nested control flow statements. Open
Open
if not any(
[
line.strip().startswith(x)
for x in PIP_REQUIREMENTS_NOCHANGE
]
Avoid deeply nested control flow statements. Open
Open
if tags[_tag] != lb['tags'][_tag]:
tags_to_update[_tag] = tags[_tag]
tags_to_add.pop(_tag)
Avoid deeply nested control flow statements. Open
Open
if 'rc' in spec[1]:
include_rc = True
available_versions = __salt__['pip.list_all_versions'](
Avoid deeply nested control flow statements. Open
Open
if 'changes' in result:
ret['comment'].append('Modifying {0} in beacons'.format(name))
ret['changes'] = result['changes']
else:
ret['comment'].append(result['comment'])
Avoid deeply nested control flow statements. Open
Open
if 'b' in spec[1]:
include_beta = True
if 'rc' in spec[1]:
Avoid deeply nested control flow statements. Open
Open
if _tag not in tags_to_remove:
tags_to_remove.append(_tag)
else:
Function min_party
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def min_party(name,
zk_hosts,
min_nodes,
blocking=False,
profile=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
Avoid deeply nested control flow statements. Open
Open
if _device in active:
_real_device = active[_device]['device']
opts = list(set(opts + active[_device]['opts'] + active[_device]['superopts']))
active[real_name]['opts'].append('bind')
break