Showing 106 of 169 total issues
Avoid too many return
statements within this function. Open
return marshal_based_on_role(user, application_session), 200
Avoid too many return
statements within this function. Open
return dict(message=msg), 422
Avoid too many return
statements within this function. Open
return marshal_based_on_role(user, workspace)
Avoid too many return
statements within this function. Open
return 'Invalid user or password', 401
Avoid too many return
statements within this function. Open
return 'Account has expired', 403
Avoid too many return
statements within this function. Open
return 'Concurrent session memory limit for workspace exceeded', 409
Avoid too many return
statements within this function. Open
return application.attribute_limits
Avoid too many return
statements within this function. Open
return val
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return marshal_based_on_role(user, workspace)
Avoid too many return
statements within this function. Open
return ts, 'image could not be pulled'
Avoid too many return
statements within this function. Open
return ts, 'starting'
Avoid too many return
statements within this function. Open
return {'error': 'User is already owner of the workspace'}, 403
Avoid too many return
statements within this function. Open
return ts, 'starting'
Avoid too many return
statements within this function. Open
return 'Invalid attribute limits, error: %s' % error, 422
Avoid too many return
statements within this function. Open
return None
Function get_application_fields_from_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_application_fields_from_config(application, field_name):
"""Hybrid fields for Application model which need processing"""
provisioning_config = get_provisioning_config(application)
if field_name == 'cost_multiplier':
- 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 load_yaml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_yaml(yaml_data):
"""
A function to load annotated yaml data into the database.
Example can be found in devel_dataset.yaml
"""
- 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 generate_application_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_application_query(user, args):
# handle admins separately
if user.is_admin:
s = select(Application).join(Application.workspace)
# admins can query deleted applications
- 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_workspace_manager
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_workspace_manager(user, workspace=None):
if workspace:
if workspace.status != Workspace.STATUS_ACTIVE:
return False
manager_cache = g.setdefault('manager_cache', dict())
- 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"