Showing 88 of 149 total issues
Function __call__
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, function):
"""
:type function: types.FunctionType
: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 security_decorator
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def security_decorator(self):
"""
Gets the security decorator for operation
From Swagger Specification:
- 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 coerce_type
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def coerce_type(param, value, parameter_type, parameter_name=None):
def make_type(value, type_literal):
type_func = TYPE_MAP.get(type_literal)
return type_func(value)
- 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
File abstract.py
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import logging
import pathlib
import sys
import warnings
File abstract.py
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import logging
from connexion.operations.secure import SecureOperation
AbstractOperation
has 35 functions (exceeds 20 allowed). Consider refactoring. 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 __call__
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, function):
"""
:type function: types.FunctionType
: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
File aiohttp_api.py
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import logging
import re
import traceback
from contextlib import suppress
Function validate_required
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def validate_required(validator, required, instance, schema):
if not validator.is_type(instance, "object"):
return
for prop in required:
- 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
File validation.py
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import copy
import functools
import logging
File openapi.py
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from copy import copy, deepcopy
from connexion.operations.abstract import AbstractOperation
File security_handler_factory.py
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import base64
import functools
import logging
import os
Function parameter_to_arg
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def parameter_to_arg(operation, function, pythonic_params=False,
pass_context_arg_name=None):
"""
Pass query and body parameters as keyword arguments to handler function.
- 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
AbstractSecurityHandlerFactory
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class AbstractSecurityHandlerFactory(abc.ABC):
"""
get_*_func -> _get_function -> get_function_from_name (name=security function defined in spec)
(if url defined instead of a function -> get_token_info_remote)
AbstractAPI
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class AbstractAPI(metaclass=AbstractAPIMeta):
"""
Defines an abstract interface for a Swagger API
"""
Function __init__
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, api, method, path, operation, resolver, app_produces, app_consumes,
File uri_parsing.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Decorators to split query and path parameters
import abc
import functools
import logging
import re
Function validate_parameter
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def validate_parameter(parameter_type, value, param, param_name=None):
if value is not None:
if is_nullable(param) and is_null(value):
return
- 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 run
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(spec_file,
File swagger2.py
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from copy import deepcopy
from connexion.operations.abstract import AbstractOperation