File breadcrumbs.py
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import absolute_import
import os
import logging
Function get_buffer
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_buffer(self):
rv = []
for idx, (payload, processor) in enumerate(self.buffer):
if processor is not None:
try:
- 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 _record_log_breadcrumb
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _record_log_breadcrumb(logger, level, msg, *args, **kwargs):
for handler in special_logging_handlers:
if handler(logger, level, msg, args, kwargs):
return
- 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 _install_httplib
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _install_httplib():
try:
from httplib import HTTPConnection
except ImportError:
from http.client import HTTPConnection
- 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 record
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def record(self, timestamp=None, level=None, message=None,
Function record
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def record(message=None, timestamp=None, level=None, category=None,
Function putrequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def putrequest(self, method, url, *args, **kwargs):
Function _record_log_breadcrumb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _record_log_breadcrumb(logger, level, msg, *args, **kwargs):
Function handler
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handler(logger, level, msg, args, kwargs):
Function _hook_requests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _hook_requests():
try:
from requests.sessions import Session
except ImportError:
return
- 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 _wrap_logging_method
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _wrap_logging_method(meth, level=None):
if not isinstance(meth, FunctionType):
func = meth.im_func
else:
func = meth
- 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"