Showing 77 of 97 total issues
Function key_match
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def key_match(key1, key2):
if len(key1) != len(key2):
return False
for p1, p2 in zip(key1, key2):
- 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_installed_middlewares
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_installed_middlewares(app):
candidates = (
FastAPIReporterMiddleware,
StarletteReporterMiddleware,
ASGIReporterMiddleware,
- 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 _apply_sensitive_post_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _apply_sensitive_post_params(request):
sensitive_post_parameters = getattr(
request, "sensitive_post_parameters", []
)
if not sensitive_post_parameters:
- 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 process_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_response(self, request, response):
if response.status_code != 404:
return response
if _should_ignore_404(request.get_full_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 get_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_type(obj):
if isinstance(obj, (string_types, binary_type)):
return STRING
if isinstance(obj, Mapping):
- 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 _build_fastapi_request_data(request)
Avoid too many return
statements within this function. Open
return _build_bottle_request_data(request)
Avoid too many return
statements within this function. Open
return self._shorten_other(val)
Avoid too many return
statements within this function. Open
return retval
Avoid too many return
statements within this function. Open
return _build_wsgi_request_data(request)
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return _build_tornado_request_data(request)
Avoid too many return
statements within this function. Open
return set_handler(
Avoid too many return
statements within this function. Open
return _build_starlette_request_data(request)
Avoid too many return
statements within this function. Open
return '<%s in %s.__repr__: %s>' % (
Avoid too many return
statements within this function. Open
return {'id': str(user_id)}
Avoid too many return
statements within this function. Open
return _build_sanic_request_data(request)
Avoid too many return
statements within this function. Open
return list_handler(
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return handler(obj, key=key)