Showing 294 of 518 total issues
Function dispatcher
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def dispatcher(router, request, response):
try:
if uwsgi is not None:
uwsgi.set_logvar('request_id', request.id)
except: # pylint: disable=bare-except
- 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_parent_tree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_parent_tree(self, _id, cont=None, projection=None, add_self=False):
parents = []
curr_storage = self
- 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 _find_or_create_destination_project
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _find_or_create_destination_project(group_id, project_label, timestamp, user):
group_id, project_label = _group_id_fuzzy_match(group_id, project_label)
group = config.db.groups.find_one({'_id': group_id})
if project_label == '':
- 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
for a in acquisitions:
a.pop('info', None)
files = a.pop('files', [])
remove_blacklisted_keys(a)
Avoid deeply nested control flow statements. Open
if code is None:
code = 'unknown_subject'
subject['code'] = code
subject_dict[code] = subject
Function update_el
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_el(self, _id, payload, unset_payload=None, recursive=False, r_payload=None, replace_metadata=False):
result = super(ProjectStorage, self).update_el(_id, payload, unset_payload=unset_payload, recursive=recursive, r_payload=r_payload, replace_metadata=replace_metadata)
if result.modified_count < 1:
raise APINotFoundException('Could not find project {}'.format(_id))
- 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
Consider simplifying this complex logical expression. Open
if access >= INTEGER_PERMISSIONS['admin']:
pass
elif method == 'POST' and access >= INTEGER_PERMISSIONS['rw'] and payload['user'] == handler.uid:
pass
elif method == 'GET' and (access >= INTEGER_PERMISSIONS['ro'] or container.get('public')):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id=None, query=None, payload=None, projection=None):
Function eval_match
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def eval_match(match_type, match_param, file_, container, regex=False):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id, query_params = None, payload = None, exclude_params=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id, query_params=None, payload=None, exclude_params=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id=None, query=None, payload=None, projection=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, query=None, user=None, public=False, projection=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id, query_params = None, payload = None, exclude_params=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id, query_params = None, payload = None, exclude_params=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id, query_params = None, payload = None, exclude_params=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, _id, query_params = None, payload = None, exclude_params=None):
Function f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f(method, query=None, user=None, public=False, projection=None):
Function create_el
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_el(self, analysis, parent_type, parent_id, origin, uid=None):
Function try_replace_one
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def try_replace_one(db, coll_name, query, update, upsert=False):