Showing 21 of 49 total issues
Function read_loop
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def read_loop(self):
"""
Infinite loop that reads messages off of the socket while not closed.
When a message is received its corresponding pending Future is set
- 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 find_server
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def find_server(self, allow_read_only):
conn = None
retry_policy = RetryPolicy.exponential_backoff(maximum=MAX_FIND_WAIT)
- 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 wait_in_line
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def wait_in_line(self, znode_label, timeout=None, blocked_by=None):
time_limit = None
if timeout is not None:
time_limit = time.time() + timeout
- 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 repair_loop
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def repair_loop(self):
while not self.closing:
yield self.state.wait_for(States.SUSPENDED, States.LOST)
if self.closing:
break
- 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 __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function event_dispatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def event_dispatch(self, event):
log.debug("Got watch event: %s", event)
if event.type:
key = (event.type, event.path)
- 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 ensure_path
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ensure_path(self, path, acl=None):
acl = acl or self.default_acl
paths_to_make = []
for segment in path[1:].split("/"):
- 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 leave
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def leave(self, timeout=None):
log.debug("Leaving double barrier %s", self.base_path)
time_limit = None
if timeout is not None:
time_limit = time.time() + timeout
- 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 make
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def make(
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, path, defaults, client, data_watcher, child_watcher):
Function worker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def worker(number, client, znode_path, allocation_fn, items):
Function set_perms
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_perms(self, read, write, create, delete, admin):
Function commit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def commit(self):
if not self.request.requests:
raise ValueError("No operations to commit.")
response = yield self.client.send(self.request)
- 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 set_existing_watches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_existing_watches(self):
if not self.watch_callbacks:
return
request = protocol.SetWatchesRequest(
- 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 send
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def send(self, request, xid=None):
f = concurrent.Future()
if self.closing:
f.set_exception(exc.ConnectError(self.host, self.port))
- 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 gather_installed_classes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gather_installed_classes(self):
for entry_point in pkg_resources.iter_entry_points(ENTRY_POINT):
try:
recipe_class = entry_point.load()
except ImportError as e:
- 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 enforce
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def enforce(self, request=None):
self.timings[id(request)].append(time.time())
tries = len(self.timings[id(request)])
if tries == 1:
- 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 __str__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
def subpart_string(part_info):
part_name, part_class = part_info
- 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"