Function cookie_from_string
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
def cookie_from_string(cookie_string, strict_cookies=False):
"""Parser for HTTP header set-cookie
The return from this function will be used as parameters for
django's response.set_cookie method. Because set_cookie doesn't
have parameter comment, this cookie attribute will be ignored.
Function should_transform
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def should_transform(self):
"""Determine if we should transform the response
:returns: A boolean value
"""
Function get_django_response
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def get_django_response(
proxy_response, strict_cookies=False, streaming_amount=None
):
"""This method is used to create an appropriate response based on the
Content-Length of the proxy_response. If the content is bigger than
Function set_response_headers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def set_response_headers(response, response_headers):
if hasattr(response, 'headers'):
Avoid too many return
statements within this function.
return False
Avoid too many return
statements within this function.
return False
Avoid too many return
statements within this function.
return False
Avoid too many return
statements within this function.
return False
Avoid too many return
statements within this function.
return True
Avoid too many return
statements within this function.
return False
Avoid too many return
statements within this function.
return cookie_dict
Function asbool
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def asbool(value):
"""Function used to convert certain string values into an appropriated
boolean value.If value is not a string the built-in python
bool function will be used to convert the passed parameter