File __init__.py
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections.abc import Iterable, Iterator, Sequence
from contextlib import contextmanager, nullcontext
from typing import TYPE_CHECKING, Any, Callable, Optional, TextIO, Union
import colorama
Function rich_print
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def rich_print( # noqa: PLR0913
Function write_json
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_json( # noqa: PLR0913
Function table
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def table(
Function write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(
Function write
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def write(
self,
*objects: Any,
style: Optional[str] = None,
sep: Optional[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 error_write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def error_write(
Function prompt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def prompt(
self,
text: str,
choices: Optional[Iterable[str]] = None,
password: bool = 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 table
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def table(
self,
data: "TableData",
headers: Optional["Headers"] = None,
markdown: bool = 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 write_json
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_json( # noqa: PLR0913
self,
data: Any,
indent: Optional[int] = None,
highlight: Optional[bool] = 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"