chrislit/abydos

View on GitHub

Showing 383 of 4,191 total issues

Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in abydos/distance/_aline.py - About 1 hr to fix

    Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in abydos/distance/_sift4_extended.py - About 1 hr to fix

      Function stem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def stem(self, word: str) -> str:
              """Return 'CLEF German stemmer plus' stem.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/stemmer/_clef_german_plus.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def encode(self, word: str) -> str:
              """Return the Roger Root code for a word.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/phonetic/_roger_root.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def encode(self, word: str) -> str:
              """Return Reth-Schek Phonetik code for a word.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/phonetic/_reth_schek.py - About 1 hr 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 _apply_rule has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def _apply_rule(
              self,
              word: str,
              rule: Tuple[bool, int, Optional[str], bool],
              intact: bool,
      Severity: Minor
      Found in abydos/stemmer/_paice_husk.py - About 1 hr 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 sim_score has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def sim_score(self, src: str, tar: str) -> float:
              """Return the Dunning similarity of two strings.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/distance/_dunning.py - About 1 hr 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 sim has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def sim(self, src: str, tar: str) -> float:
              """Return the MLIPNS similarity of two strings.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/distance/_mlipns.py - About 1 hr 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 stem has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def stem(self, word: str) -> str:
              """Return Caumanns German stem.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/stemmer/_caumanns.py - About 1 hr to fix

        Function dist_abs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def dist_abs(self, src: str, tar: str) -> float:
                """Return the Meta-Levenshtein distance of two strings.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/distance/_meta_levenshtein.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                              if (current > 0) and not _is_vowel(current - 1):
                                  primary, secondary = _metaph_add('K')
                                  current += 2
                                  continue
          
          
          Severity: Major
          Found in abydos/phonetic/_double_metaphone.py - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                            if _string_at(current, 4, {'JOSE'}) or _string_at(
                                0, 4, {'SAN '}
                            ):
                                if (
                                    (current == 0) and (_get_at(current + 4) == ' ')
            Severity: Major
            Found in abydos/phonetic/_double_metaphone.py - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                              if (
                                  (not src_len_fn and not tar_len_fn)
                                  or (tar_fn and src_fn.startswith(tar_fn))
                                  or (src_fn and tar_fn.startswith(src_fn))
                              ) and not roman_conflict:
              Severity: Major
              Found in abydos/distance/_synoname.py - About 1 hr to fix

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

                    def encode(self, word: str) -> str:
                        """Return the SoundexBR encoding of a word.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in abydos/phonetic/_soundex_br.py - About 55 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

                Function _default_download_dir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def _default_download_dir() -> Optional[str]:
                    """Return the directory to which packages will be downloaded by default.
                
                    This is mostly copied from NLTK's
                    nltk.downloader.Downloader.default_download_dir
                Severity: Minor
                Found in abydos/util/_data.py - About 55 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

                Function dist has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def dist(self, src: str, tar: str) -> float:
                        """Return the INClusion Programme value of two words.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in abydos/distance/_inclusion.py - About 55 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

                Function _fuzzy_intersection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _fuzzy_intersection(self) -> TCounter[str]:
                        r"""Return the fuzzy intersection of the tokens in src and tar.
                
                        This implements the fuzzy intersection defined by :cite:`Wang:2014`.
                
                
                Severity: Minor
                Found in abydos/distance/_token_distance.py - About 55 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

                Function sim has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def sim(self, src: str, tar: str) -> float:
                        """Return the Steffensen similarity of two strings.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in abydos/distance/_steffensen.py - About 55 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

                Function sim has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def sim(self, src: str, tar: str) -> float:
                        """Return Cao's CY similarity (CYs) of two strings.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in abydos/distance/_cao.py - About 55 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

                Function sim_score has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def sim_score(self, src: str, tar: str) -> float:
                        """Return the Gotoh score of two strings.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in abydos/distance/_gotoh.py - About 55 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

                Severity
                Category
                Status
                Source
                Language