rollbar/pyrollbar

View on GitHub

Showing 97 of 97 total issues

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 default_handler(obj, key=key)
    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 SET
        Severity: Major
        Found in rollbar/lib/type_info.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return _build_falcon_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_basic(val, self._repr.maxlong)
            Severity: Major
            Found in rollbar/lib/transforms/shortener.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

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

                  Avoid too many return statements within this function.
                  Open

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

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

                    def _build_wsgi_request_data(request):
                        request_data = {
                            'url': wsgiref.util.request_uri(request),
                            'user_ip': _wsgi_extract_user_ip(request),
                            'method': request.get('REQUEST_METHOD'),
                    Severity: Minor
                    Found in rollbar/__init__.py - About 25 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 prefix_match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def prefix_match(key, prefixes):
                        if not key:
                            return False
                    
                        for prefix in prefixes:
                    Severity: Minor
                    Found in rollbar/lib/__init__.py - About 25 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_setting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _get_setting(self, name, default=None):
                            try:
                                return self.settings[name]
                            except KeyError:
                                if name in DEFAULTS:
                    Severity: Minor
                    Found in rollbar/contrib/django/middleware.py - About 25 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 _walk_trace_chain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def _walk_trace_chain(cls, exc, trace):
                        trace_chain = [_trace_data(cls, exc, trace)]
                    
                        seen_exceptions = {exc}
                    
                    
                    Severity: Minor
                    Found in rollbar/__init__.py - About 25 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_max_size has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _get_max_size(self, obj):
                            for name, _type in _type_name_mapping.items():
                                # Special case for dicts since we are using collections.abc.Mapping
                                # to provide better type checking for dict-like objects
                                if name == 'mapping':
                    Severity: Minor
                    Found in rollbar/lib/transforms/shortener.py - About 25 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 resolve_logging_types has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def resolve_logging_types(obj):
                        if isinstance(obj, (dict, ConvertingDict)):
                            return {k: resolve_logging_types(v) for k, v in obj.items()}
                        elif isinstance(obj, (list, ConvertingList)):
                            return [resolve_logging_types(i) for i in obj]
                    Severity: Minor
                    Found in rollbar/logger.py - About 25 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 parse_settings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def parse_settings(settings):
                        prefix = 'rollbar.'
                        out = {}
                        for k, v in settings.items():
                            if k.startswith(prefix):
                    Severity: Minor
                    Found in rollbar/contrib/pyramid/__init__.py - About 25 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 _shorten has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _shorten(self, val):
                            max_size = self._get_max_size(val)
                    
                            if isinstance(val, dict):
                                val = self._shorten_mapping(val, max_size)
                    Severity: Minor
                    Found in rollbar/lib/transforms/shortener.py - About 25 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

                    Severity
                    Category
                    Status
                    Source
                    Language