Showing 4 of 4 total issues
Function add_subscriber
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_subscriber(self, subscriber: AbstractEventSubscriber):
"""
Adds an event subscriber. The subscriber is asked for all the events he is
interested in and added as a listener for these events.
- 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 remove_subscriber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def remove_subscriber(self, subscriber: AbstractEventSubscriber):
"""
Removes an event subscriber.
:param subscriber: The subscriber
- 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 get_listeners
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_listeners(self, event_name: str = None) -> Sequence[Callable[[Event, str, Any], Event]]:
"""
Gets the listener of a specific event or all listeners stored by
descending priority.
- 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 remove_listener
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remove_listener(self, event_name: str, listener: Callable):
"""
Removes an event listener from the specified events.
:param event_name: The event to remove a listener from
- 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"