Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
if not perms:
for perm in cur_perms['Not Inherited'][user_name][access_mode]['permissions']:
for flag in flags().ace_perms[obj_type]['advanced']:
if flags().ace_perms[obj_type]['advanced'][flag] == perm:
perm_flag = flag
Avoid deeply nested control flow statements. Open
if user not in changes:
changes[user] = {}
changes[user][access_mode] = new_perms[user]['perms']
Function copy_security
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_security(source,
target,
obj_type='file',
copy_owner=True,
copy_group=True,
- 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 user_name in cur_perms['Not Inherited'] and \
access_mode in cur_perms['Not Inherited'][user_name]:
for flag in flags().ace_prop[obj_type]:
if flags().ace_prop[obj_type][flag] == cur_perms['Not Inherited'][user_name][access_mode]['applies to']:
at_flag = flag
Avoid deeply nested control flow statements. Open
if i == old:
v[x] = new
x = x + 1
Avoid deeply nested control flow statements. Open
if obj_type == 'file':
applies_to = 'this_folder_subfolders_files'
elif 'registry' in obj_type:
applies_to = 'this_key_subkeys'
else:
Function os_script
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def os_script(os_, vm_=None, opts=None, minion=''):
'''
Return the script as a string for the specific os
'''
if minion:
- 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(i, six.string_types):
b = find_and_process_re(i, v, k, b, expanded)
Function vb_machine_exists
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def vb_machine_exists(name):
'''
Checks in with the hypervisor to see if the machine with the given name is known
@param name:
@type name:
- 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(after_items_update[name], list):
after_items_update[name].extend(data)
else:
Avoid deeply nested control flow statements. Open
for perm in cur_perms['Not Inherited'][user_name][access_mode]['permissions']:
for flag in flags().ace_perms[obj_type]['basic']:
if flags().ace_perms[obj_type]['basic'][flag] == perm:
perm_flag = flag
for flag1 in flags().ace_perms[obj_type]['basic']:
Avoid deeply nested control flow statements. Open
if __opts__['test'] is True:
if 'remove_perms' not in ret['changes']:
ret['changes']['remove_perms'] = {}
ret['changes']['remove_perms'].update(
{user_name: cur_perms['Not Inherited'][user_name]})
Avoid deeply nested control flow statements. Open
if not cur_perms['Not Inherited'][user_name][access_mode]['applies to'] == applies_to_text:
if user not in changes:
changes[user] = {}
changes[user]['applies_to'] = applies_to
Avoid deeply nested control flow statements. Open
for flag in flags().ace_prop[obj_type]:
if flags().ace_prop[obj_type][flag] == cur_perms['Not Inherited'][user_name]['deny']['applies to']:
at_flag = flag
for flag1 in flags().ace_prop[obj_type]:
if flags().ace_prop[obj_type][flag1] == at_flag:
Avoid deeply nested control flow statements. Open
with salt.utils.files.fopen(true_path, 'rb') as handle:
plist = plistlib.load(handle)
Function get_definition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_definition(self):
'''Returns the definition of the complex item'''
serialized = super(ComplexSchemaItem, self).serialize()
# Adjust entries in the serialization
- 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 prepare_kwargs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def prepare_kwargs(all_kwargs, class_init_kwargs):
'''
Filter out the kwargs used for the init of the class and the kwargs used to
invoke the command required.
- 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 len(comps) > 1 or comps[0] != 'tmp':
ret = root_cmd(
'chown {0} "{1}"'.format(username, tmp_dir),
tty, sudo, **ssh_kwargs
)
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, id_, module, func, **kwargs):
self.id_ = id_
self.module = module
self.func = func
- 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 force_minion_config:
deploy_command += ' -F'
if make_syndic is True: