Showing 12 of 31 total issues
Function collect_endpoints
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def collect_endpoints(self, app: Flask, blueprint=_MISSING, endpoint=None,
exclude_blueprint=_MISSING, exclude_endpoint=None) \
-> dict:
"""Collect endpoints in rules.
- 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 make_dict_factory
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def make_dict_factory(schema):
requireds = []
defaults = {}
fields = schema.fields
- 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 merge
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def merge(dest, src):
"""Merge plain objects without mutation."""
if isinstance(dest, dict) and isinstance(src, dict):
dest = dest.copy()
src = src.copy()
- 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 normalize_indent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def normalize_indent(docstring):
"""
Normalized indent of docstring.
"""
lines = docstring.split('\n')
- 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 parse_werkzeug_rule
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_werkzeug_rule(self, rule: str, ctx: dict) -> PathAndParams:
"""
Convert werkzeug rule to swagger path format and
extract parameter info.
"""
- 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 extract_paths
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_paths(self, app: Flask, blueprint=_MISSING, endpoint=None,
Function generate_swagger
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_swagger(self, app: Flask=current_app, swagger_info=None,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, app: Flask=None, extractor: Extractor=None,
Function simple_param
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def simple_param(self, in_, name, python_type, optional=False, **kwargs):
Function collect_endpoints
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def collect_endpoints(self, app: Flask, blueprint=_MISSING, endpoint=None,
Function response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def response(self, status, response_or_description, schema=None,
headers=None):
"""Mark response field for view to view.
There are two ways to use this decorator.
- 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 convert_annotation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert_annotation(self, name, annotation, ctx: dict):
"""Convert function annotation to swagger parameter object."""
if annotation is None:
return None
if not isinstance(annotation, type):
- 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"