Showing 97 of 97 total issues
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return default_handler(obj, key=key)
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return SET
Avoid too many return
statements within this function. Open
return _build_falcon_request_data(request)
Avoid too many return
statements within this function. Open
return self._shorten_basic(val, self._repr.maxlong)
Avoid too many return
statements within this function. Open
return DEFAULT
Avoid too many return
statements within this function. Open
return mapping_handler(
Avoid too many return
statements within this function. Open
return LIST
Function _build_wsgi_request_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _build_wsgi_request_data(request):
request_data = {
'url': wsgiref.util.request_uri(request),
'user_ip': _wsgi_extract_user_ip(request),
'method': request.get('REQUEST_METHOD'),
- 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 prefix_match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prefix_match(key, prefixes):
if not key:
return False
for prefix in prefixes:
- 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_setting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_setting(self, name, default=None):
try:
return self.settings[name]
except KeyError:
if name in DEFAULTS:
- 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 _walk_trace_chain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _walk_trace_chain(cls, exc, trace):
trace_chain = [_trace_data(cls, exc, trace)]
seen_exceptions = {exc}
- 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_max_size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_max_size(self, obj):
for name, _type in _type_name_mapping.items():
# Special case for dicts since we are using collections.abc.Mapping
# to provide better type checking for dict-like objects
if name == '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
Function resolve_logging_types
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resolve_logging_types(obj):
if isinstance(obj, (dict, ConvertingDict)):
return {k: resolve_logging_types(v) for k, v in obj.items()}
elif isinstance(obj, (list, ConvertingList)):
return [resolve_logging_types(i) for i in obj]
- 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_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_settings(settings):
prefix = 'rollbar.'
out = {}
for k, v in settings.items():
if k.startswith(prefix):
- 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 _shorten
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _shorten(self, val):
max_size = self._get_max_size(val)
if isinstance(val, dict):
val = self._shorten_mapping(val, max_size)
- 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"