Showing 77 of 97 total issues
Function _build_request_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _build_request_data(request):
"""
Returns a dictionary containing data from the request.
"""
- 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 redact
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def redact(self, url_string):
_redact = super(ScrubUrlTransform, self).redact
missing_colon_double_slash = False
- 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 build_key_matcher
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_key_matcher(prefixes_or_suffixes, type='prefix', case_sensitive=False):
_prefixes = []
if type == 'prefix':
_iter = iter
- 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 _build_starlette_request_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _build_starlette_request_data(request):
from starlette.datastructures import UploadFile
request_data = {
'url': str(request.url),
- 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 transform_custom
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def transform_custom(self, o, key=None):
if o is None:
return None
# Best to be very careful when we call user code in the middle of
- 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 is_current_version_higher_or_equal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def is_current_version_higher_or_equal(current_version, min_version):
"""
Compare two version strings and return True if the current version is higher or equal to the minimum version.
Note: This function only compares the release segment of the version string.
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function report_exc_info
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def report_exc_info(exc_info=None, request=None, extra_data=None, payload_data=None, level=None, **kw):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function transform_dict
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def transform_dict(self, o, key=None):
ret = {}
for k, v in o.items():
if isinstance(k, string_types) or isinstance(k, binary_type):
if isinstance(k, bytes):
- 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
Avoid deeply nested control flow statements. Open
for i, arg in enumerate(temp_varargs):
temp_varargs[i] = REDACT_REF
Function _add_person_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _add_person_data(data, request):
try:
person_data = _build_person_data(request)
except Exception as e:
log.exception("Exception while building person data for Rollbar payload: %r", e)
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, access_token, path, page_num, params, data, endpoint=None):
Function search_items
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def search_items(title, return_fields=None, access_token=None, endpoint=None, **search_fields):
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def init(access_token, environment='production', scrub_fields=None, url_fields=None, **kw):
Function do_transform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def do_transform(transform, type_name, val, key=None, **kw):
Function _report_exc_info
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _report_exc_info(exc_info, request, extra_data, payload_data, level=None):
Function _report_message
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _report_message(message, level, request, extra_data, payload_data):
Function _parse_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _parse_response(path, access_token, params, resp, endpoint=None):
Function report_message
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def report_message(message, level='error', request=None, extra_data=None, payload_data=None):