chrislit/abydos

View on GitHub

Showing 383 of 4,191 total issues

Lovins has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

class Lovins(_Stemmer):
    """Lovins stemmer.

    The Lovins stemmer is described in Julie Beth Lovins's article
    :cite:`Lovins:1968`.
Severity: Minor
Found in abydos/stemmer/_lovins.py - About 4 hrs to fix

    Function stem_dict has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def stem_dict(self, word: str) -> Dict[str, str]:
            """Return the stem of a word according to the Schinke stemmer.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/stemmer/_schinke.py - About 4 hrs 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

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

        def __init__(
            self,
            transforms: Optional[
                Union[
                    Type[_Phonetic],
    Severity: Minor
    Found in abydos/distance/_phonetic_distance.py - About 4 hrs 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

    Function dist_abs has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def dist_abs(self, src: str, tar: str) -> float:
            """Return the "simplest" Sift4 distance between two terms.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/distance/_sift4_simplest.py - About 4 hrs 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

    Function _alignment_matrix has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def _alignment_matrix(
            self, src: str, tar: str, backtrace: bool = True
        ) -> Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]:
            """Return the Levenshtein alignment matrix.
    
    
    Severity: Minor
    Found in abydos/distance/_levenshtein.py - About 4 hrs 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

    Function _alignment_matrix has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def _alignment_matrix(
            self, src: str, tar: str, backtrace: bool = True
        ) -> Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]:
            """Return the phonetic edit distance alignment matrix.
    
    
    Severity: Minor
    Found in abydos/distance/_phonetic_edit_distance.py - About 4 hrs 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

    File _phonix.py has 349 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Copyright 2014-2020 by Christopher C. Little.
    # This file is part of Abydos.
    #
    # Abydos is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    Severity: Minor
    Found in abydos/phonetic/_phonix.py - About 4 hrs to fix

      _TokenDistance has 34 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class _TokenDistance(_Distance):
          r"""Abstract Token Distance class.
      
          .. _confusion_table:
      
      
      Severity: Minor
      Found in abydos/distance/_token_distance.py - About 4 hrs to fix

        Function encode has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def encode(self, word: str) -> str:
                """Return the Norphone code.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/phonetic/_norphone.py - About 4 hrs 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

        Function encode has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def encode(self, word: str) -> str:
                """Return the IBM Alpha Search Inquiry System code for a word.
        
                A collection is necessary as the return type since there can be
                multiple values for a single word. But the collection must be ordered
        Severity: Minor
        Found in abydos/phonetic/_alpha_sis.py - About 4 hrs 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

        Function dist_abs has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            def dist_abs(self, src: str, tar: str) -> float:
                """Return the Editex distance between two strings.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/distance/_editex.py - About 3 hrs 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

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

            def __init__(
                self,
                corpus_text: str = '',
                doc_split: str = '\n\n',
                sent_split: str = '\n',
        Severity: Minor
        Found in abydos/corpus/_corpus.py - About 3 hrs 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

        Function encode has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            def encode(self, word: Union[str, Sequence[str]]) -> str:
                """Return the Standardized Phonetic Frequency Code (SPFC) of a word.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/phonetic/_spfc.py - About 3 hrs 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

        Function tokenize has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            def tokenize(self, string: str) -> 'COrVClusterTokenizer':
                """Tokenize the term and store it.
        
                The tokenized term is stored as an ordered list and as a Counter
                object.
        Severity: Minor
        Found in abydos/tokenizer/_c_or_v_cluster.py - About 3 hrs 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

        Function tokenize has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            def tokenize(self, string: str) -> 'QGrams':
                """Tokenize the term and store it.
        
                The tokenized term is stored as an ordered list and as a Counter
                object.
        Severity: Minor
        Found in abydos/tokenizer/_q_grams.py - About 3 hrs 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

        File _sfinx_bis.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # Copyright 2014-2020 by Christopher C. Little.
        # This file is part of Abydos.
        #
        # Abydos is free software: you can redistribute it and/or modify
        # it under the terms of the GNU General Public License as published by
        Severity: Minor
        Found in abydos/phonetic/_sfinx_bis.py - About 3 hrs to fix

          File _porter.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # Copyright 2014-2020 by Christopher C. Little.
          # This file is part of Abydos.
          #
          # Abydos is free software: you can redistribute it and/or modify
          # it under the terms of the GNU General Public License as published by
          Severity: Minor
          Found in abydos/stemmer/_porter.py - About 3 hrs to fix

            File _levenshtein.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # Copyright 2014-2020 by Christopher C. Little.
            # This file is part of Abydos.
            #
            # Abydos is free software: you can redistribute it and/or modify
            # it under the terms of the GNU General Public License as published by
            Severity: Minor
            Found in abydos/distance/_levenshtein.py - About 3 hrs to fix

              File _typo.py has 312 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright 2018-2020 by Christopher C. Little.
              # This file is part of Abydos.
              #
              # Abydos is free software: you can redistribute it and/or modify
              # it under the terms of the GNU General Public License as published by
              Severity: Minor
              Found in abydos/distance/_typo.py - About 3 hrs to fix

                File _porter2.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # Copyright 2014-2020 by Christopher C. Little.
                # This file is part of Abydos.
                #
                # Abydos is free software: you can redistribute it and/or modify
                # it under the terms of the GNU General Public License as published by
                Severity: Minor
                Found in abydos/stemmer/_porter2.py - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language