Function generate_msgs
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def generate_msgs(
source_Nc: Observable,
rate_node: float,
name: str,
rate_in: float,
- 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 convert
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def convert(space: eagerx.Space, processor, name, component, node, direction="out"):
OUTPUT = True if direction == "out" else False
INPUT = True if direction == "in" else False
space_checked = [False]
p_msg = f" (after processing with `{processor.__class__.__qualname__}`)" if processor else ""
- 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 remap_cb_input
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def remap_cb_input(mode=0):
def _remap_cb_input(value):
# mode=0 (info only), mode=1 (msgs only), mode=2 (all)
if mode == 2:
return value
- 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 regroup_inputs
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def regroup_inputs(node, rate_node=1, is_input=True, perform_checks=True):
node_name = node.ns_name
color = node.color
def _regroup_inputs(source):
- 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 throttle_with_time
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def throttle_with_time(dt, node, rate_tol: float = 0.95, log_level: int = DEBUG):
time_fn = lambda: time.monotonic_ns() / 1e9 # noqa: E731
node_name = node.ns_name
color = node.color
effective_log_level = node.backend.log_level
- 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 trace_observable
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def trace_observable(
id: str,
node,
trace_next=False,
trace_next_payload=False,
- 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 with_latest_from
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def with_latest_from(*sources: Observable):
def _with_latest_from(parent: Observable) -> Observable:
NO_VALUE = NotSet()
def subscribe(observer, scheduler=None):
- 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 switch_to_reset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def switch_to_reset():
def _switch_to_reset(source):
def subscribe(observer, scheduler=None):
reset_mode = [False]
- 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 filter_dict
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def filter_dict():
def _filter_dict(source):
def subscribe(observer, scheduler=None):
def on_next(value):
d = dict()
- 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_state_inputs_channel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_state_inputs_channel(ns, state_inputs, scheduler, node):
if len(state_inputs) > 0:
channels = []
for s in state_inputs:
d = s["done"].pipe(
- 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
Avoid deeply nested control flow statements. Open
if mode == 0:
i[key] = filter_info_for_printing(msg.info)
else:
i[key] = msg.msgs
else:
Function init_state_resets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_state_resets(ns, state_inputs, trigger, scheduler, tp_scheduler, node):
if len(state_inputs) > 0:
channels = []
for s in state_inputs:
- 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_real_reset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def init_real_reset(
ns,
Nc,
rate_node,
RR,
- 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 cb_ft
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cb_ft(cb_input, sync):
# Fill output msg with number of node ticks
output_msgs = dict()
for key, msg in cb_input.items():
if key not in ["node_tick", "t_n"]:
- 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"