Showing 845 of 1,621 total issues
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return {'ok': False,
Avoid too many return
statements within this function. Open
return {'ok': True}
Avoid too many return
statements within this function. Open
return {'ok': False,
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return (True, 'success')
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return default
Function update_user_emitter_policy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_user_emitter_policy(self, node, action, policy, obj_ui_field, field_chef, obj_ui, objold_ui, priority_obj, priority_obj_ui, field_ui, update_by_path):
'''
Update node chef with a mergeable user emitter policy
This policy is emitter, that is that the policy contains related objects (storage)
'''
- 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 group_by_multiple_keys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def group_by_multiple_keys(self, input_data, mergeIdField, mergeActionField, opposite=False):
'''
This method groups by key the values of a list of dictionaries and eliminates the duplicates
or those that are opposed.
- 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 is_path_right
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_path_right(request, path, ou_type='ou_managed'):
ou_managed_ids = []
if path is None:
path = ''
- 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 script_runner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def script_runner(user, sequence, rollback=False):
''' Launches scripts from an update
Args:
user(object): user doing update
- 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 users_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def users_list(obj_ui, obj, node, field_chef, *kwargs):
users = deepcopy(node.attributes.get_dotted(field_chef))
if not users:
users = {}
else:
- 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 __acl__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __acl__(self):
user = self.request.user
if user:
if user.get('is_superuser', False):
return [(Allow, Authenticated, 'edit'), (Allow, Authenticated, 'is_superuser')]
- 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 search_mergefields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def search_mergefields(self, field_chef, field_ui, policy):
'''
This method search merge indexes (mergeIdField, mergeActionField) for "field_chef" policy field.
Args:
- 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 get_first_exists_node
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_first_exists_node(self, ids, obj, action):
'''
Get the first exising node from a ids list
'''
for mongo_id in ids:
- 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"