Function print_io_status
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def print_io_status(self, node_names=None):
# Only print status for specific node
if node_names is None:
node_names = self.node_io.keys()
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 connect_io
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def connect_io(self, print_status=True):
# If log_level is not high enough, overwrite print_status
if self.effective_log_level > DEBUG:
print_status = 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 add_rx_objects
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def add_rx_objects(
self,
node_name,
node=None,
inputs=tuple(),
- 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 cname_address in self.connected_rx[node_name][key]:
assert color is None, f"Duplicate connection status for address ({cname_address})."
color = "green"
if cname_address in self.connected_bnd[node_name][key]:
Avoid deeply nested control flow statements. Open
if cname_address in self.disconnected[node_name][key]:
color = "red"
if cname_address in self.connected_rx[node_name][key]:
Avoid deeply nested control flow statements. Open
if cname_address in self.connected_bnd[node_name][key]:
assert color is None, f"Duplicate connection status for address ({cname_address})."
color = "blue"
assert (