Showing 88 of 149 total issues
Function _query_args_helper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _query_args_helper(self, query_defns, query_arguments,
function_arguments, has_kwargs, sanitize):
res = {}
for key, value in query_arguments.items():
key = sanitize(key)
- 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_body_and_status_code
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_body_and_status_code(cls, data, mimetype, status_code=None, extra_context=None):
if data is NoContent:
data = None
if status_code is None:
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, status=400, title=None, detail=None, type=None,
Function problem
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def problem(status, title, detail, type=None, instance=None, headers=None, ext=None):
Function get_arguments
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_arguments(self, path_params, query_params, body, files, arguments,
Function from_spec
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_spec(cls, spec, api, path, method, resolver, *args, **kwargs):
Function from_spec
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_spec(cls, spec, api, path, method, resolver, *args, **kwargs):
Function _generic_check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _generic_check(self, func, exception_msg):
need_to_add_context, need_to_add_required_scopes = self._need_to_add_context_or_scopes(func)
def wrapper(request, *args, required_scopes=None):
kwargs = {}
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, schema, consumes, api, is_null_value_valid=False, validator=None,
Avoid deeply nested control flow statements. Open
if 'x-writeOnly' in validator.VALIDATORS and subschema.get('x-writeOnly') is True:
continue
yield ValidationError("%r is a required property" % prop)
Function _build_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_response(cls, data, mimetype, content_type=None, headers=None, status_code=None, extra_context=None):
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run(self, port=None, server=None, debug=None, host=None, **options):
if port is not None:
self.port = port
elif self.port is None:
self.port = 5000
- 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 'writeOnly' in validator.VALIDATORS and subschema.get('writeOnly'):
continue
if 'x-writeOnly' in validator.VALIDATORS and subschema.get('x-writeOnly') is True:
Function _build_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_response(cls, mimetype, content_type=None, headers=None, status_code=None, data=None, extra_context=None):
Function _build_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_response(cls, data, mimetype, content_type=None, status_code=None, headers=None, extra_context=None):
Avoid deeply nested control flow statements. Open
if 'readOnly' in validator.VALIDATORS and subschema.get('readOnly'):
continue
if 'writeOnly' in validator.VALIDATORS and subschema.get('writeOnly'):
Function _get_body_argument
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_body_argument(self, body, arguments, has_kwargs, sanitize):
x_body_name = sanitize(self.body_schema.get('x-body-name', 'body'))
if is_nullable(self.body_schema) and is_null(body):
return {x_body_name: None}
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, api, status_code, exception, security, security_definitions):
Function run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, port=None, server=None, debug=None, host=None, **options):
Function update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(self, id=None, name=None, animal_type=None, tags=None, created=None):