chrislit/abydos

View on GitHub

Showing 383 of 4,191 total issues

Function _synoname_word_approximation has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
Open

    def _synoname_word_approximation(
        self,
        src_ln: str,
        tar_ln: str,
        src_fn: str = '',
Severity: Minor
Found in abydos/distance/_synoname.py - About 1 day 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 81 (exceeds 5 allowed). Consider refactoring.
Open

    def encode(self, word: str) -> str:
        """Calculate the early version of the Henry code for a word.

        Parameters
        ----------
Severity: Minor
Found in abydos/phonetic/_henry_early.py - About 1 day 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 _synoname.py has 694 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: Major
Found in abydos/distance/_synoname.py - About 1 day to fix

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

        def stem(self, word: str) -> str:
            """Return Snowball German stem.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/stemmer/_snowball_german.py - About 1 day 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 74 (exceeds 5 allowed). Consider refactoring.
    Open

        def encode(self, word: str) -> str:
            """Return the Haase Phonetik (numeric output) code for a word.
    
            While the output code is numeric, it is nevertheless a str.
    
    
    Severity: Minor
    Found in abydos/phonetic/_haase.py - About 1 day 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 a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

        def stem(self, word: str) -> str:
            """Return Snowball Dutch stem.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/stemmer/_snowball_dutch.py - About 1 day 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 _mean.py has 647 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: Major
    Found in abydos/stats/_mean.py - About 1 day to fix

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

          def encode(self, word: str) -> str:
              """Return the Spanish Metaphone of a word.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/phonetic/_spanish_metaphone.py - About 1 day 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 70 (exceeds 5 allowed). Consider refactoring.
      Open

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

          def _stem_and_rule(self, word: str) -> Tuple[str, float]:
              """Return UEA-Lite stem.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/stemmer/_uea_lite.py - About 1 day 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

      ConfusionTable has 69 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ConfusionTable:
          """ConfusionTable object.
      
          This object is initialized by passing either four integers (or a tuple of
          four integers) representing the squares of a confusion table:
      Severity: Major
      Found in abydos/stats/_confusion_table.py - About 1 day to fix

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

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

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

            def encode(self, word: str) -> str:
                """Return the Dolby Code of a name.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/phonetic/_dolby.py - About 1 day 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 55 (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/_discounted_levenshtein.py - About 1 day 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 53 (exceeds 5 allowed). Consider refactoring.
        Open

            def dist_abs(self, src: str, tar: str) -> float:
                """Return the Sift4 Extended distance between two strings.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/distance/_sift4_extended.py - About 1 day 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 53 (exceeds 5 allowed). Consider refactoring.
        Open

            def dist_abs(self, src: str, tar: str) -> float:
                """Return the "common" Sift4 distance between two terms.
        
                Parameters
                ----------
        Severity: Minor
        Found in abydos/distance/_sift4.py - About 1 day 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_final_rules has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

            def _apply_final_rules(
                self,
                phonetic: str,
                final_rules: Tuple[Any, ...],
                language_arg: int,
        Severity: Minor
        Found in abydos/phonetic/_beider_morse.py - About 7 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 _nrl.py has 483 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/phonetic/_nrl.py - About 7 hrs to fix

          Function _phonetic has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

              def _phonetic(
                  self,
                  term: str,
                  name_mode: str,
                  rules: Tuple[Any, ...],
          Severity: Minor
          Found in abydos/phonetic/_beider_morse.py - About 7 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

          Severity
          Category
          Status
          Source
          Language