connexion/operations/abstract.py
File abstract.py
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import abc
import logging
from connexion.operations.secure import SecureOperation
AbstractOperation
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class AbstractOperation(SecureOperation, metaclass=abc.ABCMeta):
"""
An API routes requests to an Operation by a (path, method) pair.
The operation uses a resolver to resolve its handler function.
Function __init__
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, api, method, path, operation, resolver,
Function function
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def function(self):
"""
Operation function with decorators
:rtype: types.FunctionType
- 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 _query_args_helper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
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 get_arguments
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_arguments(self, path_params, query_params, body, files, arguments,
Function _query_args_helper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _query_args_helper(self, query_defns, query_arguments,