chrislit/abydos

View on GitHub

Showing 383 of 4,191 total issues

File _beider_morse_data.py has 5470 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2014-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# This file is based on Alexander Beider and Stephen P. Morse's implementation
# of the Beider-Morse Phonetic Matching (BMPM) System, available at
Severity: Major
Found in abydos/phonetic/_beider_morse_data.py - About 2 wks to fix

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

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

        def encode(self, word: str) -> str:
            """Return the Double Metaphone code for a word.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/phonetic/_double_metaphone.py - About 1 wk 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 _aline.py has 1627 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Copyright 2019-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/_aline.py - About 4 days to fix

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

          def stem(self, word: str) -> str:
              """Return Porter stem.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/stemmer/_porter.py - About 4 days 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 _phonet.py has 1551 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/phonetic/_phonet.py - About 4 days to fix

        File _confusion_table.py has 1528 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/_confusion_table.py - About 4 days to fix

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

              def stem(self, word: str) -> str:
                  """Return the Porter2 (Snowball English) stem.
          
                  Parameters
                  ----------
          Severity: Minor
          Found in abydos/stemmer/_porter2.py - About 4 days 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 alignments has a Cognitive Complexity of 171 (exceeds 5 allowed). Consider refactoring.
          Open

              def alignments(
                  self, src: str, tar: str, score_only: bool = False
              ) -> Union[float, List[Tuple[float, str, str]]]:
                  """Return the ALINE alignments of two strings.
          
          
          Severity: Minor
          Found in abydos/distance/_aline.py - About 3 days 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_tuple has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
          Open

              def fingerprint_tuple(
                  self, lname: str, fname: str = '', qual: str = '', normalize: int = 0
              ) -> Tuple[str, str, str]:
                  """Build the Synoname toolcode.
          
          
          Severity: Minor
          Found in abydos/fingerprint/_synoname_toolcode.py - About 2 days 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 _lovins.py has 1006 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/stemmer/_lovins.py - About 2 days to fix

            Function _group_linkage_intersection has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
            Open

                def _group_linkage_intersection(self) -> TCounter[str]:
                    r"""Return the group linkage intersection of the tokens in src and tar.
            
                    This is based on group linkage, as defined by :cite:`On:2007`.
            
            
            Severity: Minor
            Found in abydos/distance/_token_distance.py - About 2 days 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_type has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
            Open

                def sim_type(
                    self,
                    src: Union[str, Tuple[str, str, str]],
                    tar: Union[str, Tuple[str, str, str]],
                    force_numeric: bool = False,
            Severity: Minor
            Found in abydos/distance/_synoname.py - About 2 days 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 _phones.py has 910 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/phones/_phones.py - About 2 days to fix

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

                  def encode(self, word: str) -> str:
                      """Return the Metaphone code for a word.
              
                      Based on Lawrence Philips' Pick BASIC code from 1990
                      :cite:`Philips:1990`, as described in :cite:`Philips:1990b`.
              Severity: Minor
              Found in abydos/phonetic/_metaphone.py - About 2 days 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 __init__.py has 875 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/distance/__init__.py - About 2 days to fix

                File _double_metaphone.py has 797 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/phonetic/_double_metaphone.py - About 1 day to fix

                  File _beider_morse.py has 791 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # Copyright 2014-2020 by Christopher C. Little.
                  # This file is part of Abydos.
                  #
                  # This file is based on Alexander Beider and Stephen P. Morse's implementation
                  # of the Beider-Morse Phonetic Matching (BMPM) System, available at
                  Severity: Major
                  Found in abydos/phonetic/_beider_morse.py - About 1 day to fix

                    File _token_distance.py has 780 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/_token_distance.py - About 1 day to fix

                      File _uea_lite.py has 738 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/stemmer/_uea_lite.py - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language