Showing 44 of 92 total issues
Function post
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def post(
Function unparse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def unparse(input_dict, output=None, encoding='utf-8', full_document=True,
**kwargs):
"""Emit an XML document for the given `input_dict` (reverse of `parse`).
The resulting XML document is returned as a string, but if `output` (a
- 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 put
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def put(
Function _get_11paths_serialized_headers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_11paths_serialized_headers(x_headers):
"""
Prepares and returns a string ready to be signed from the 11-paths specific HTTP headers
received.
- 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 patch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def patch(
Function guess_file_name_stream_type_header
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def guess_file_name_stream_type_header(args):
"""
Guess filename, file stream, file type, file header from args.
:param args: may be string (filepath), 2-tuples (filename, fileobj), 3-tuples (filename,
- 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 unparse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def unparse(input_dict, output=None, encoding='utf-8', full_document=True,
Function generate_url_path
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_url_path(
Function log_print_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_print_request(method, url, query_params=None, headers=None, body=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, headers=None, status=None, status_text=None, http_version=None, body=None):
Function generate_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_url(scheme=None, host=None, port=None, path=None, query=None):
Function to_key_val_list
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_key_val_list(value, sort=False, insensitive=False):
"""
Take an object and test to see if it can be represented as a
dictionary. If it can be, return a list of tuples, e.g.,
::
- 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 apply_authentication
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_authentication(self, context):
context.headers[X_11PATHS_DATE_HEADER_NAME] = self.utc or _get_utc()
if context.method == POST_METHOD or context.method == PUT_METHOD:
if CONTENT_TYPE_HEADER_NAME in context.headers and \
context.headers[CONTENT_TYPE_HEADER_NAME].lower().startswith(
- 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 too many return
statements within this function. Open
return urlencode(data, doseq=False), self.content_type
Avoid too many return
statements within this function. Open
return b'\n'.join(result), self.get_content_type(charset)
Avoid too many return
statements within this function. Open
return b"\n".join(results), self.get_content_type(charset)
Avoid too many return
statements within this function. Open
return '&'.join(results), self.content_type
Avoid too many return
statements within this function. Open
return default_renderer
Avoid too many return
statements within this function. Open
return data, self.content_type
Avoid too many return
statements within this function. Open
return b'\n'.join(results), self.get_content_type(charset)