chrislit/abydos

View on GitHub

Showing 4,191 of 4,191 total issues

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

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

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, 92
    Severity: Major
    Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return stemmed_word, rule_no
      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, 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, 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[:-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, 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 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 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
                      Severity: Major
                      Found in abydos/stemmer/_porter2.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, 90.2
                          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 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 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
                                    Severity: Major
                                    Found in abydos/stemmer/_uea_lite.py - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language