abydos/tokenizer/_nltk.py
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(
self,
nltk_tokenizer: Optional[object] = None,
scaler: Optional[Union[str, Callable[[float], float]]] = 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
Wrong hanging indentation before block (add 4 spaces). Open
Open
hasattr(nltk_tokenizer, 'tokenize')
- Read upRead up
- Exclude checks
TODO hasattr(nltk_tokenizer, 'tokenize') ^ |
Wrong hanging indentation before block (add 4 spaces). Open
Open
and 'nltk.tokenize' in nltk_tokenizer.__module__
- Read upRead up
- Exclude checks
TODO and 'nltk.tokenize' in nltktokenizer.module_ ^ |
Wrong hanging indentation before block (add 4 spaces). Open
Open
scaler: Optional[Union[str, Callable[[float], float]]] = None,
- Read upRead up
- Exclude checks
TODO scaler: Optional[Union[str, Callable[[float], float]]] = None, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
Open
self,
- Read upRead up
- Exclude checks
TODO self, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
Open
nltk_tokenizer: Optional[object] = None,
- Read upRead up
- Exclude checks
TODO nltk_tokenizer: Optional[object] = None, ^ |