rollbar/pyrollbar

View on GitHub

Showing 77 of 97 total issues

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

def key_match(key1, key2):
    if len(key1) != len(key2):
        return False

    for p1, p2 in zip(key1, key2):
Severity: Minor
Found in rollbar/lib/__init__.py - About 35 mins to fix

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_installed_middlewares has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def get_installed_middlewares(app):
    candidates = (
        FastAPIReporterMiddleware,
        StarletteReporterMiddleware,
        ASGIReporterMiddleware,
Severity: Minor
Found in rollbar/contrib/fastapi/utils.py - About 35 mins to fix

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_sensitive_post_params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _apply_sensitive_post_params(request):
    sensitive_post_parameters = getattr(
        request, "sensitive_post_parameters", []
    )
    if not sensitive_post_parameters:
Severity: Minor
Found in rollbar/contrib/django/middleware.py - About 35 mins to fix

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 process_response has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def process_response(self, request, response):
        if response.status_code != 404:
            return response

        if _should_ignore_404(request.get_full_path()):
Severity: Minor
Found in rollbar/contrib/django/middleware.py - About 35 mins to fix

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_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def get_type(obj):
    if isinstance(obj, (string_types, binary_type)):
        return STRING

    if isinstance(obj, Mapping):
Severity: Minor
Found in rollbar/lib/type_info.py - About 35 mins to fix

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 _build_fastapi_request_data(request)
Severity: Major
Found in rollbar/__init__.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return _build_bottle_request_data(request)
    Severity: Major
    Found in rollbar/__init__.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return self._shorten_other(val)
      Severity: Major
      Found in rollbar/lib/transforms/shortener.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return retval
        Severity: Major
        Found in rollbar/__init__.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return _build_wsgi_request_data(request)
          Severity: Major
          Found in rollbar/__init__.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return
            Severity: Major
            Found in rollbar/__init__.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return _build_tornado_request_data(request)
              Severity: Major
              Found in rollbar/__init__.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return set_handler(
                Severity: Major
                Found in rollbar/lib/traverse.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return _build_starlette_request_data(request)
                  Severity: Major
                  Found in rollbar/__init__.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return '<%s in %s.__repr__: %s>' % (
                    Severity: Major
                    Found in rollbar/lib/transforms/serializable.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return {'id': str(user_id)}
                      Severity: Major
                      Found in rollbar/__init__.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return _build_sanic_request_data(request)
                        Severity: Major
                        Found in rollbar/__init__.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return list_handler(
                          Severity: Major
                          Found in rollbar/lib/traverse.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return None
                            Severity: Major
                            Found in rollbar/__init__.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                  return handler(obj, key=key)
                              Severity: Major
                              Found in rollbar/lib/traverse.py - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language