chrislit/abydos

View on GitHub
abydos/phonetic/_beider_morse.py

Summary

Maintainability
F
4 days
Test Coverage

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

    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

    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

    Cyclomatic complexity is too high in method _phonetic. (24)
    Open

        def _phonetic(
            self,
            term: str,
            name_mode: str,
            rules: Tuple[Any, ...],
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _apply_final_rules. (18)
    Open

        def _apply_final_rules(
            self,
            phonetic: str,
            final_rules: Tuple[Any, ...],
            language_arg: int,
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method __init__. (11)
    Open

        def __init__(
            self,
            language_arg: Union[str, int] = 0,
            name_mode: str = 'gen',
            match_mode: str = 'approx',
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _apply_rule_if_compat. (8)
    Open

        def _apply_rule_if_compat(
            self, phonetic: str, target: str, language_arg: int
        ) -> Optional[str]:
            """Apply a phonetic regex if compatible.
    
    
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in class BeiderMorse. (7)
    Open

    class BeiderMorse(_Phonetic):
        """Beider-Morse Phonetic Matching.
    
        The Beider-Morse Phonetic Matching algorithm is described in
        :cite:`Beider:2008`.
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _normalize_lang_attrs. (6)
    Open

        def _normalize_lang_attrs(self, text: str, strip: bool) -> str:
            """Remove embedded bracketed attributes.
    
            This (potentially) bitwise-ands bracketed attributes together and adds
            to the end.
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _expand_alternates. (6)
    Open

        def _expand_alternates(self, phonetic: str) -> str:
            r"""Expand phonetic alternates separated by \|s.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _language. (6)
    Open

        def _language(self, name: str, name_mode: str) -> int:
            """Return the best guess language ID for the word and language choices.
    
            Parameters
            ----------
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function _apply_rule_if_compat has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def _apply_rule_if_compat(
            self, phonetic: str, target: str, language_arg: int
        ) -> Optional[str]:
            """Apply a phonetic regex if compatible.
    
    
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            language_arg: Union[str, int] = 0,
            name_mode: str = 'gen',
            match_mode: str = 'approx',
    Severity: Minor
    Found in abydos/phonetic/_beider_morse.py - About 1 hr 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 _phonetic has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _phonetic(
    Severity: Major
    Found in abydos/phonetic/_beider_morse.py - About 50 mins to fix

      Function _redo_language has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _redo_language(
      Severity: Minor
      Found in abydos/phonetic/_beider_morse.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if phonetic[i] == ']':
                                    i += 1
                                    phonetic2 += phonetic[attrib_start:i]
                                    break
                                i += 1
        Severity: Major
        Found in abydos/phonetic/_beider_morse.py - About 45 mins to fix

          Function _language has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def _language(self, name: str, name_mode: str) -> int:
                  """Return the best guess language ID for the word and language choices.
          
                  Parameters
                  ----------
          Severity: Minor
          Found in abydos/phonetic/_beider_morse.py - About 45 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 _expand_alternates has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def _expand_alternates(self, phonetic: str) -> str:
                  r"""Expand phonetic alternates separated by \|s.
          
                  Parameters
                  ----------
          Severity: Minor
          Found in abydos/phonetic/_beider_morse.py - About 45 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 deeply nested control flow statements.
          Open

                                  if not search(left, phoneticx[:i]):
                                      continue
          
                              # check for incompatible attributes
                              candidate = self._apply_rule_if_compat(
          Severity: Major
          Found in abydos/phonetic/_beider_morse.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if not search(right, phoneticx[i + pattern_length :]):
                                        continue
            
                                # check that left context is satisfied
                                if lcontext != '':
            Severity: Major
            Found in abydos/phonetic/_beider_morse.py - About 45 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Minor
              Found in abydos/phonetic/_beider_morse.py - About 35 mins to fix

                Function _normalize_lang_attrs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _normalize_lang_attrs(self, text: str, strip: bool) -> str:
                        """Remove embedded bracketed attributes.
                
                        This (potentially) bitwise-ands bracketed attributes together and adds
                        to the end.
                Severity: Minor
                Found in abydos/phonetic/_beider_morse.py - About 25 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

                Refactor this function to reduce its Cognitive Complexity from 49 to the 15 allowed.
                Open

                    def _phonetic(
                Severity: Critical
                Found in abydos/phonetic/_beider_morse.py by sonar-python

                Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                See

                Refactor this function to reduce its Cognitive Complexity from 51 to the 15 allowed.
                Open

                    def _apply_final_rules(
                Severity: Critical
                Found in abydos/phonetic/_beider_morse.py by sonar-python

                Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                See

                Method "_phonetic" has 8 parameters, which is greater than the 7 authorized.
                Open

                        self,
                        term: str,
                        name_mode: str,
                        rules: Tuple[Any, ...],
                        final_rules1: Tuple[Any, ...],

                A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                Noncompliant Code Example

                With a maximum number of 4 parameters:

                def do_something(param1, param2, param3, param4, param5):
                    ...
                

                Compliant Solution

                def do_something(param1, param2, param3, param4):
                    ...
                

                Too many arguments (6/5)
                Open

                    def __init__(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method takes too many arguments.

                Method could be a function
                Open

                    def _phonetic_number(self, phonetic: str) -> str:
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a method doesn't use its bound instance, and so could be written as a function.

                Too many local variables (20/15)
                Open

                    def _apply_final_rules(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method has too many local variables.

                Unnecessary elif after return
                Open

                        if attrib == uninitialized or strip:
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.

                Too many statements (57/50)
                Open

                    def _phonetic(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method has too many statements. You should then split it in smaller functions / methods.

                Method could be a function
                Open

                    def _language_index_from_code(self, code: int, name_mode: str) -> int:
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a method doesn't use its bound instance, and so could be written as a function.

                Consider merging these comparisons with in to alternate not in ('', '[0]')
                Open

                            if alternate != '' and alternate != '[0]':
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                To check if a variable is equal to one of many values,combine the values into a tuple and check if the variable is contained in it instead of checking for equality against each of the values.This is faster and less verbose.

                Method could be a function
                Open

                    def _normalize_lang_attrs(self, text: str, strip: bool) -> str:
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a method doesn't use its bound instance, and so could be written as a function.

                Method could be a function
                Open

                    def _language(self, name: str, name_mode: str) -> int:
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a method doesn't use its bound instance, and so could be written as a function.

                Too many branches (16/12)
                Open

                    def _apply_final_rules(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method has too many branches, making it hard to follow.

                Too many arguments (7/5)
                Open

                    def _redo_language(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method takes too many arguments.

                Too many arguments (8/5)
                Open

                    def _phonetic(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method takes too many arguments.

                Too many branches (23/12)
                Open

                    def _phonetic(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method has too many branches, making it hard to follow.

                Method could be a function
                Open

                    def _remove_dupes(self, phonetic: str) -> str:
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a method doesn't use its bound instance, and so could be written as a function.

                Too many local variables (28/15)
                Open

                    def _phonetic(
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a function or method has too many local variables.

                Merge this if statement with the enclosing one.
                Open

                                        if not search(left, phoneticx[:i]):

                Merging collapsible if statements increases the code's readability.

                Noncompliant Code Example

                if condition1:
                    if condition2:
                        # ...
                

                Compliant Solution

                if condition1 and condition2:
                    # ...
                

                Merge this if statement with the enclosing one.
                Open

                                    if not search(left, term[:i]):

                Merging collapsible if statements increases the code's readability.

                Noncompliant Code Example

                if condition1:
                    if condition2:
                        # ...
                

                Compliant Solution

                if condition1 and condition2:
                    # ...
                

                Merge this if statement with the enclosing one.
                Open

                                    if not search(right, term[i + pattern_length :]):

                Merging collapsible if statements increases the code's readability.

                Noncompliant Code Example

                if condition1:
                    if condition2:
                        # ...
                

                Compliant Solution

                if condition1 and condition2:
                    # ...
                

                Merge this if statement with the enclosing one.
                Open

                                        if not search(right, phoneticx[i + pattern_length :]):

                Merging collapsible if statements increases the code's readability.

                Noncompliant Code Example

                if condition1:
                    if condition2:
                        # ...
                

                Compliant Solution

                if condition1 and condition2:
                    # ...
                

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        term: str,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO term: str, ^ |

                Consider using enumerate instead of iterating with range and len
                Open

                        for k in range(len(phonetic_array)):
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        self,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO self, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        concat: bool,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO concat: bool, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        language_arg: int = 0,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO language_arg: int = 0, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        language_arg: int,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO language_arg: int, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        final_rules2: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO final_rules2: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        self,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO self, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                                    term[i : i + pattern_length] != pattern
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO term[i : i + pattern_length] != pattern ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        final_rules: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO final_rules: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        rules: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO rules: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        final_rules1: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO final_rules1: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        self, phonetic: str, target: str, language_arg: int
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO self, phonetic: str, target: str, language_arg: int ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        language_arg: Union[str, int] = 0,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO language_arg: Union[str, int] = 0, ^ |

                Too many lines in module (1026/1000)
                Open

                # Copyright 2014-2020 by Christopher C. Little.
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Used when a module has too many lines, reducing its readability.

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        name_mode: str,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO name_mode: str, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        final_rules2: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO final_rules2: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        concat: bool = False,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO concat: bool = False, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        self,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO self, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        self,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO self, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        phonetic: str,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO phonetic: str, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        match_mode: str = 'approx',
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO match_mode: str = 'approx', ^ |

                Consider using enumerate instead of iterating with range and len
                Open

                        for i in range(len(candidate_array)):
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        name_mode: str,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO name_mode: str, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                                        i : i + pattern_length
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO i : i + pattern_length ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        concat: bool = False,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO concat: bool = False, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        filter_langs: bool = False,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO filter_langs: bool = False, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        term: str,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO term: str, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                            _LANG_DICT[_] for _ in BMDATA[name_mode]['languages']
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO LANGDICT[_] for _ in BMDATA[name_mode]['languages'] ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        rules: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO rules: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        name_mode: str = 'gen',
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO name_mode: str = 'gen', ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        final_rules1: Tuple[Any, ...],
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO final_rules1: Tuple[Any, ...], ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                                not found
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO not found ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                        strip: bool,
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO strip: bool, ^ |

                Wrong hanging indentation before block (add 4 spaces).
                Open

                            code & (code - 1)
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                TODO code & (code - 1) ^ |

                Consider using enumerate instead of iterating with range and len
                Open

                        for i in range(len(alt_array)):
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.

                Consider using enumerate instead of iterating with range and len
                Open

                        for i in range(len(alt_array)):
                Severity: Info
                Found in abydos/phonetic/_beider_morse.py by pylint

                Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.

                There are no issues that match your filters.

                Category
                Status