chrislit/abydos

View on GitHub

Showing 383 of 4,191 total issues

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

    def dist(self, src: str, tar: str) -> float:
        """Return the average linkage distance of two strings.

        Parameters
        ----------
Severity: Minor
Found in abydos/distance/_average_linkage.py - About 35 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_abs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def dist_abs(self, src: str, tar: str) -> float:
        """Return the Levenshtein distance between two strings.

        Parameters
        ----------
Severity: Minor
Found in abydos/distance/_discounted_levenshtein.py - About 35 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 fingerprint_int has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def fingerprint_int(self, word: str) -> int:
        """Return the occurrence fingerprint.

        Parameters
        ----------
Severity: Minor
Found in abydos/fingerprint/_occurrence.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def sim(self, src: str, tar: str) -> float:
        """Return the suffix similarity of two strings.

        Suffix similarity is the ratio of the length of the shorter term that
        exactly matches the longer term to the length of the shorter term,
Severity: Minor
Found in abydos/distance/_suffix.py - About 35 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 alignment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def alignment(self, src: str, tar: str) -> Tuple[float, str, str]:
        """Return the Levenshtein alignment of two strings.

        Parameters
        ----------
Severity: Minor
Found in abydos/distance/_levenshtein.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def sim_score(self, src: str, tar: str) -> float:
        """Return the Fellegi-Sunter similarity of two strings.

        Parameters
        ----------
Severity: Minor
Found in abydos/distance/_fellegi_sunter.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def sim(self, src: str, tar: str) -> float:
        """Return the prefix similarity of two strings.

        Prefix similarity is the ratio of the length of the shorter term that
        exactly matches the longer term to the length of the shorter term,
Severity: Minor
Found in abydos/distance/_prefix.py - About 35 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

Avoid too many return statements within this function.
Open

                    return word[:-1], 91.1
Severity: Major
Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return word, 97
    Severity: Major
    Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return sdx[: self._max_length]
      Severity: Major
      Found in abydos/phonetic/_soundex.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return word
        Severity: Major
        Found in abydos/stemmer/_porter2.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return word, 93
          Severity: Major
          Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return word
            Severity: Major
            Found in abydos/stemmer/_porter2.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return len(nums) / sum(1.0 / float(i) for i in nums)  # type: ignore
              Severity: Major
              Found in abydos/stats/_mean.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return word, 90.3
                Severity: Major
                Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return word, 90.1
                  Severity: Major
                  Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                            return word, 96
                    Severity: Major
                    Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return word, 91
                      Severity: Major
                      Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return False
                        Severity: Major
                        Found in abydos/stats/_confusion_table.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return word, 90
                          Severity: Major
                          Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language