Showing 16 of 16 total issues
File context.py
has 871 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
__all__ = (
"ResourceEvent",
"ResourceConflict",
Function dispatch_raw
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def dispatch_raw(self, event: Event) -> Awaitable[bool]:
"""
Dispatch the given event object to all listeners.
Creates a new task in which all listener callbacks are called with the given event as
- 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 run_application
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def run_application(
component: Component | dict[str, Any],
*,
event_loop_policy: str | None = None,
max_threads: int | None = 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 merge_config
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def merge_config(
original: dict[str, Any] | None, overrides: dict[str, Any] | None
) -> dict[str, Any]:
"""
Return a copy of the ``original`` configuration dictionary, with overrides from ``overrides``
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(
configfile,
unsafe: bool,
loop: str | None,
service: str | 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 executor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def executor(
func_or_executor: Executor | str | Callable[Concatenate[Context, P], T_Retval],
) -> (
Callable[
[Callable[Concatenate[Context, P], T_Retval]],
- 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 stream_events
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def stream_events(
signals: Sequence[Signal[T_Event]],
filter: Callable[[T_Event], bool] | None = None,
*,
max_queue_size: int = 0,
- 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 old_lines is not None and old_lines != new_lines:
self.changed.dispatch(old_lines, new_lines)
Function run_application
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_application(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function add_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_resource(
Function run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(
Function call_in_executor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def call_in_executor(
Function add_resource_factory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_resource_factory(
Function run_complete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_complete(f: Future[int | None]) -> None:
# If run() raised an exception, print it with a traceback and exit with code 1
exc = f.exception()
if exc is not None:
print_exception(type(exc), exc, exc.__traceback__)
- 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"