TracyWebTech/django-revproxy

View on GitHub

Showing 12 of 12 total issues

Function cookie_from_string has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

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.
Severity: Minor
Found in revproxy/utils.py - About 5 hrs to fix

Function should_transform has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def should_transform(self):
"""Determine if we should transform the response
 
:returns: A boolean value
"""
Severity: Minor
Found in revproxy/transformer.py - About 1 hr to fix

Function get_django_response has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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
Severity: Minor
Found in revproxy/response.py - About 55 mins to fix

Function set_response_headers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def set_response_headers(response, response_headers):
# check for Django 3.2 headers interface
# https://code.djangoproject.com/ticket/31789
# check and set pointer before loop to improve efficiency
if hasattr(response, 'headers'):
Severity: Minor
Found in revproxy/utils.py - About 35 mins to fix

Avoid too many return statements within this function.
Open

return False
Severity: Major
Found in revproxy/transformer.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return False
    Severity: Major
    Found in revproxy/transformer.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return False
      Severity: Major
      Found in revproxy/transformer.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return False
        Severity: Major
        Found in revproxy/transformer.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return True
          Severity: Major
          Found in revproxy/transformer.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return False
            Severity: Major
            Found in revproxy/transformer.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return cookie_dict
              Severity: Major
              Found in revproxy/utils.py - About 30 mins to fix

                Function asbool has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                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
                 
                 
                Severity: Minor
                Found in revproxy/transformer.py - About 25 mins to fix
                Severity
                Category
                Status
                Source
                Language