connexion/decorators/uri_parsing.py
File uri_parsing.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Decorators to split query and path parameters
import abc
import functools
import logging
import re
Function resolve_params
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def resolve_params(self, params, _in):
"""
takes a dict of parameters, and resolves the values into
the correct array type handling duplicate values, and splitting
based on the collectionFormat defined in the spec.
- 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 resolve_form
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def resolve_form(self, form_data):
if self._body_schema is None or self._body_schema.get('type') != 'object':
return form_data
for k in form_data:
encoding = self._body_encoding.get(k, {"style": "form"})
- 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"