chrislit/abydos

View on GitHub
abydos/tokenizer/_nltk.py

Summary

Maintainability
A
25 mins
Test Coverage

Function __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(
        self,
        nltk_tokenizer: Optional[object] = None,
        scaler: Optional[Union[str, Callable[[float], float]]] = None,
    ) -> None:
Severity: Minor
Found in abydos/tokenizer/_nltk.py - About 25 mins to fix

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

            hasattr(nltk_tokenizer, 'tokenize')
Severity: Info
Found in abydos/tokenizer/_nltk.py by pylint

TODO hasattr(nltk_tokenizer, 'tokenize') ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

            and 'nltk.tokenize' in nltk_tokenizer.__module__
Severity: Info
Found in abydos/tokenizer/_nltk.py by pylint

TODO and 'nltk.tokenize' in nltktokenizer.module_ ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        scaler: Optional[Union[str, Callable[[float], float]]] = None,
Severity: Info
Found in abydos/tokenizer/_nltk.py by pylint

TODO scaler: Optional[Union[str, Callable[[float], float]]] = None, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        self,
Severity: Info
Found in abydos/tokenizer/_nltk.py by pylint

TODO self, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        nltk_tokenizer: Optional[object] = None,
Severity: Info
Found in abydos/tokenizer/_nltk.py by pylint

TODO nltk_tokenizer: Optional[object] = None, ^ |

There are no issues that match your filters.

Category
Status