Showing 106 of 169 total issues
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, worker_id, config, cluster_config, client, controller_name):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id, target, source, status, data):
Function add_provisioning_log
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_provisioning_log(self, application_session_id, message, timestamp=None, log_type='provisioning',
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, application_session_id, log_level, log_type, timestamp, message):
Function toggle_enable_template
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def toggle_enable_template(form, args, application_template):
"""Logic for activating and deactivating a application template"""
if form.is_enabled.raw_data:
application_template.is_enabled = form.is_enabled.raw_data[0] # WTForms Issue#451
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 check_membership_expiry_policy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_membership_expiry_policy(mep):
""" Return validation errors for given membership expiry policy or None if successful """
if not isinstance(mep, dict):
return 'membership expiry policy must be a dict'
kind = mep.get('kind')
- 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_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_data(file, update=False):
"""
Loads an annotated YAML file into database. Use -u/--update to update existing entries instead of skipping.
"""
with open(file, 'r') as f:
- 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 __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self):
for k, default in vars(BaseConfig).items():
if type(default) is tuple and len(default) == 2:
default, doc_ = default
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 __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, ext_id, password=None, is_admin=False, email_id=None, expiry_ts=None, pseudonym=None,
workspace_quota=None):
self.id = uuid.uuid4().hex
self.ext_id = ext_id
self.is_admin = is_admin
- 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 post
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def post(self):
res = []
for entry in request.json:
target = entry.get('target')
- 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 env_string_to_dict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def env_string_to_dict(keyval_string):
""" Extract a dictionary from space separated key=val formatted string """
res = dict()
for keyval in keyval_string.split():
if '=' not in keyval:
- 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 patch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def patch(self, workspace_id):
parser = reqparse.RequestParser()
parser.add_argument('new_owner_id', type=str)
args = parser.parse_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
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 val
Avoid too many return
statements within this function. Open
return ts, 'starting'
Avoid too many return
statements within this function. Open
return {'error': 'User %s needs owner privileges, please contact administrator' % args.new_owner_id}, 403
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 application.attribute_limits
Avoid too many return
statements within this function. Open
return 'There is already an existing session for this application', 409
Avoid too many return
statements within this function. Open
return ts, 'image could not be pulled'