Showing 9,400 of 17,590 total issues
Function ext_pillar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url,
with_grains=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 isinstance(chg['diff'], six.string_types):
msg = 'File changed:\n{0}'.format(chg['diff'])
if all([isinstance(x, dict) for x in six.itervalues(chg)]):
Function ext_pillar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url,
with_grains=False,
username=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
if type_name in type_specific_pillar_attributes:
type_specific_pillar_attribute = type_specific_pillar_attributes[type_name]
vmware_pillar[pillar_key] = dictupdate.update(vmware_pillar[pillar_key],
Function compile_state_usage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compile_state_usage(self):
'''
Return all used and unused states for the minion based on the top match data
'''
err = []
- 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 funcs:
for func in funcs:
f_key = '{0}{1}'.format(
mod,
func[func.rindex('.'):]
Avoid deeply nested control flow statements. Open
for sub_sls in state.pop('include'):
if isinstance(sub_sls, dict):
sub_sls, v = next(six.iteritems(sub_sls))
defaults = v.get('defaults', {})
key = v.get('key', None)
Avoid deeply nested control flow statements. Open
if ignore_missing:
if saltenv not in self.ignored_pillars:
self.ignored_pillars[saltenv] = []
self.ignored_pillars[saltenv].extend(states.keys())
top[saltenv][tgt] = matches
Avoid deeply nested control flow statements. Open
if not self.opts.get('pillar_includes_override_sls', False):
# merge included state(s) with the current state
# merged last to ensure that its values are
# authoritative.
include_states.append(state)
Avoid deeply nested control flow statements. Open
if all([('old' in x and 'new' in x)
for x in six.itervalues(chg)]):
msg = 'Made the following changes:\n'
for pkg in chg:
old = chg[pkg]['old']
Avoid deeply nested control flow statements. Open
if isinstance(ctop[saltenv][tgt], six.string_types):
ctop[saltenv][tgt] = [ctop[saltenv][tgt]]
for comp in ctop[saltenv][tgt]:
Avoid deeply nested control flow statements. Open
if isinstance(entry, dict):
low_name = next(six.iterkeys(entry))
live['name'] = low_name
list(map(live.update, entry[low_name]))
else:
Avoid deeply nested control flow statements. Open
for fun in funcs:
live['fun'] = fun
chunks.append(live)
else:
Avoid deeply nested control flow statements. Open
for arg in high[nid][state]:
if not isinstance(arg, dict):
continue
if len(arg) != 1:
continue
Avoid deeply nested control flow statements. Open
if isinstance(arg, six.string_types):
fun += 1
if ' ' in arg.strip():
errors.append(('The function "{0}" in state '
'"{1}" in SLS "{2}" has '
Avoid deeply nested control flow statements. Open
if isinstance(entry, dict):
low_name = next(six.iterkeys(entry))
live['name'] = low_name
list(map(live.update, entry[low_name]))
else:
Avoid deeply nested control flow statements. Open
if isinstance(items, dict):
# Formatted as a single req_in
for _state, name in six.iteritems(items):
# Not a use requisite_in
Avoid deeply nested control flow statements. Open
if 'duration' in pdat[key]:
now = time.time()
if now - start > pdat[key]['duration']:
return 'run'
if 'kill' in pdat[key]:
Avoid deeply nested control flow statements. Open
if not any(lkey == cref[0] and lval in cref for cref in crefs):
rerror = {_l_tag(lkey, lval):
{
'comment': 'Referenced state {0}: {1} does not exist'.format(lkey, lval),
'name': 'listen_{0}:{1}'.format(lkey, lval),
Avoid deeply nested control flow statements. Open
for to_tag in to_tags:
if to_tag not in running:
continue
if running[to_tag]['changes']:
if not any(key[0] == cref[0] and key[1] in cref for cref in crefs):