Showing 69 of 69 total issues
Function _tcp_outgoing
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
def _tcp_outgoing(self):
"""
Executed within a thread. It sends internal Decider state updates,
stored in the outgoing queue, to external `BoboCEP` instances.
"""
- 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
File tcp.py
has 616 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2019-2023 r3w0p
# The following code can be redistributed and/or
# modified under the terms of the MIT License.
"""
File decider.py
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2019-2023 r3w0p
# The following code can be redistributed and/or
# modified under the terms of the MIT License.
"""
Function on_distributed_update
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def on_distributed_update(
self,
completed: List[BoboRunSerial],
halted: List[BoboRunSerial],
updated: List[BoboRunSerial]) -> 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 _tcp_incoming_handle_client
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _tcp_incoming_handle_client(
self, client_s, client_addr, client_accepted: int) -> None:
"""
Handles an incoming client request.
:param client_s: The client socket.
- 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 _check_against_patterns
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def _check_against_patterns(self, event: BoboEvent) -> \
Tuple[List[BoboRun], List[BoboRun]]:
"""
:param event: An event.
- 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 _check_against_runs
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def _check_against_runs(self, event: BoboEvent) -> \
Tuple[List[BoboRun], List[BoboRun], List[BoboRun]]:
"""
:param event: An event.
- 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 _process_not_loop
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def _process_not_loop(self,
event: BoboEvent,
block: BoboPatternBlock,
temp_index: int) -> bool:
"""
- 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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, events: Dict[str, List[BoboEvent]]):
"""
:param events: The history of events.
Keys are group names.
Values are lists of BoboEvent instances associated with a group.
- 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
File handler.py
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2019-2023 r3w0p
# The following code can be redistributed and/or
# modified under the terms of the MIT License.
"""
Function __init__
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
File run.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2019-2023 r3w0p
# The following code can be redistributed and/or
# modified under the terms of the MIT License.
"""
BoboDecider
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class BoboDecider(BoboEngineTask,
BoboDeciderPublisher,
BoboReceiverSubscriber,
BoboDistributedSubscriber):
"""
Function update
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def update(self) -> bool:
"""
Updates the receiver, then the decider, then the producer, and
finally to the forwarder.
It updates each task `n` times, depending on how many times were
- 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 snapshot
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def snapshot(self) -> Tuple[
List[BoboRunSerial], List[BoboRunSerial], List[BoboRunSerial]
]:
"""
A snapshot of the current state of the Decider.
- 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 evaluate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def evaluate(self, event: BoboEvent, history: BoboHistory) -> bool:
"""
:param event: The event used for evaluation.
:param history: The history of currently accepted events.
:return: `True` if predicate is satisfied; `False` otherwise.
- 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 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self,
urn: str,
decider: BoboDeciderPublisher,
devices: List[BoboDevice],
crypto: BoboDistributedCrypto,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function _process_loop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _process_loop(self,
event: BoboEvent,
block: BoboPatternBlock,
temp_index: int) -> bool:
"""
- 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 process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process(self, event: BoboEvent) -> bool:
"""
:param event: An event for the run to process.
:return: `True` if the event caused a state change in the run;
`False` otherwise.
- 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"