chrislit/abydos

View on GitHub

Showing 383 of 4,191 total issues

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

    def encode(self, word: str) -> str:
        """Return the Phonix code for a word.

        Parameters
        ----------
Severity: Minor
Found in abydos/phonetic/_phonix.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 _synoname_toolcode.py has 474 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/fingerprint/_synoname_toolcode.py - About 7 hrs to fix

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

        def sim(self, src: str, tar: str) -> float:
            """Return the Jaro or Jaro-Winkler similarity of two strings.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/distance/_jaro_winkler.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

    Function alignments has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def alignments(
            self, src: str, tar: str, top_n: Optional[int] = None
        ) -> List[Alignment]:
            """Return the Covington alignments of two strings.
    
    
    Severity: Minor
    Found in abydos/distance/_covington.py - About 6 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

    Function __init__ has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            tokenizer: Optional[_Tokenizer] = None,
            intersection_type: str = 'crisp',
            **kwargs: Any
    Severity: Minor
    Found in abydos/distance/_token_distance.py - About 6 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

    Function download_package has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

    def download_package(
        resource_name: str,
        url: Optional[str] = None,
        data_path: Optional[str] = None,
        force: bool = False,
    Severity: Minor
    Found in abydos/util/_data.py - About 6 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

    Function fingerprint has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        def fingerprint(self, word: str) -> str:
            """Return the Library of Congress Cutter table encoding of a word.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/fingerprint/_lc_cutter.py - About 6 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

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

        def encode(self, word: str) -> str:
            """Return the Phonex code for a word.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/phonetic/_phonex.py - About 6 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

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

        def encode(self, word: str) -> str:
            """Return the Kölner Phonetik (numeric output) code for a word.
    
            While the output code is numeric, it is still a str because 0s can lead
            the code.
    Severity: Minor
    Found in abydos/phonetic/_koelner.py - About 6 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

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

        def encode(self, lname: str) -> str:
            """Calculate the PSHP Soundex/Viewex Coding of a last name.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/phonetic/_pshp_soundex_last.py - About 6 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

    Function corr has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        def corr(self, src: str, tar: str) -> float:
            """Return the Iterative-SubString correlation of two strings.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/distance/_iterative_substring.py - About 6 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

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

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

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

        def encode(self, word: str) -> str:
            """Return the SfinxBis code for a word.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/phonetic/_sfinx_bis.py - About 5 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

    Function dist_abs has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def dist_abs(self, src: str, tar: str) -> float:
            """Return the typo distance between two strings.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/distance/_typo.py - About 5 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 _daitch_mokotoff.py has 373 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: Minor
    Found in abydos/phonetic/_daitch_mokotoff.py - About 4 hrs to fix

      Function dist_abs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          def dist_abs(self, src: str, tar: str) -> float:
              """Return the Rees-Levenshtein distance of two strings.
      
              This is a straightforward port of the PL/SQL implementation at
              https://confluence.csiro.au/public/taxamatch/the-mdld-modified-damerau-levenshtein-distance-algorithm
      Severity: Minor
      Found in abydos/distance/_rees_levenshtein.py - About 4 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

      Function dist_abs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          def dist_abs(self, src: str, tar: str) -> float:
              """Return the Higuera-Micó distance between two strings.
      
              This is a straightforward implementation of Higuera & Micó pseudocode
              from :cite:`Higuera:2008`, ported to Numpy.
      Severity: Minor
      Found in abydos/distance/_higuera_mico.py - About 4 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

      Function dist_abs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          def dist_abs(self, src: str, tar: str) -> float:
              """Return the Damerau-Levenshtein distance between two strings.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/distance/_damerau_levenshtein.py - About 4 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

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

          def sim(self, src: str, tar: str) -> float:
              """Return the Baystat similarity.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/distance/_baystat.py - About 4 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

      Function _edit_with_moves has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          def _edit_with_moves(self, src: str, tar: str) -> int:
              """Return the edit distance between two strings using ins, del, & move.
      
              Parameters
              ----------
      Severity: Minor
      Found in abydos/distance/_shapira_storer_i.py - About 4 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