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
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,
- Read upRead up
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, ...],
- Read upRead up
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, ...],
- Read upRead up
- Exclude checks
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. |
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,
- Read upRead up
- Exclude checks
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. |
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',
- Read upRead up
- Exclude checks
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. |
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.
- Read upRead up
- Exclude checks
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. |
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`.
- Read upRead up
- Exclude checks
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. |
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.
- Read upRead up
- Exclude checks
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. |
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
----------
- Read upRead up
- Exclude checks
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. |
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
----------
- Read upRead up
- Exclude checks
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. |
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.
- Read upRead up
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',
- Read upRead up
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(
Function _redo_language
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _redo_language(
Avoid deeply nested control flow statements. Open
if phonetic[i] == ']':
i += 1
phonetic2 += phonetic[attrib_start:i]
break
i += 1
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
----------
- Read upRead up
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
----------
- Read upRead up
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(
Avoid deeply nested control flow statements. Open
if not search(right, phoneticx[i + pattern_length :]):
continue
# check that left context is satisfied
if lcontext != '':
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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.
- Read upRead up
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(
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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, ...],
- Read upRead up
- Exclude checks
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__(
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Method could be a function Open
def _phonetic_number(self, phonetic: str) -> str:
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
Used when a function or method has too many local variables.
Unnecessary elif
after return
Open
if attrib == uninitialized or strip:
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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]':
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
Used when a function or method has too many branches, making it hard to follow.
Too many arguments (7/5) Open
def _redo_language(
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many arguments (8/5) Open
def _phonetic(
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many branches (23/12) Open
def _phonetic(
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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]):
- Read upRead up
- Exclude checks
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]):
- Read upRead up
- Exclude checks
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 :]):
- Read upRead up
- Exclude checks
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 :]):
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
TODO term: str, ^ |
Consider using enumerate instead of iterating with range and len Open
for k in range(len(phonetic_array)):
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
TODO self, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
concat: bool,
- Read upRead up
- Exclude checks
TODO concat: bool, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
language_arg: int = 0,
- Read upRead up
- Exclude checks
TODO language_arg: int = 0, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
language_arg: int,
- Read upRead up
- Exclude checks
TODO language_arg: int, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
final_rules2: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO final_rules2: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
self,
- Read upRead up
- Exclude checks
TODO self, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
term[i : i + pattern_length] != pattern
- Read upRead up
- Exclude checks
TODO term[i : i + pattern_length] != pattern ^ |
Wrong hanging indentation before block (add 4 spaces). Open
final_rules: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO final_rules: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
rules: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO rules: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
final_rules1: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO final_rules1: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
self, phonetic: str, target: str, language_arg: int
- Read upRead up
- Exclude checks
TODO self, phonetic: str, target: str, language_arg: int ^ |
Wrong hanging indentation before block (add 4 spaces). Open
language_arg: Union[str, int] = 0,
- Read upRead up
- Exclude checks
TODO language_arg: Union[str, int] = 0, ^ |
Too many lines in module (1026/1000) Open
# Copyright 2014-2020 by Christopher C. Little.
- Read upRead up
- Exclude checks
Used when a module has too many lines, reducing its readability.
Wrong hanging indentation before block (add 4 spaces). Open
name_mode: str,
- Read upRead up
- Exclude checks
TODO name_mode: str, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
final_rules2: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO final_rules2: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
concat: bool = False,
- Read upRead up
- Exclude checks
TODO concat: bool = False, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
self,
- Read upRead up
- Exclude checks
TODO self, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
self,
- Read upRead up
- Exclude checks
TODO self, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
phonetic: str,
- Read upRead up
- Exclude checks
TODO phonetic: str, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
match_mode: str = 'approx',
- Read upRead up
- Exclude checks
TODO match_mode: str = 'approx', ^ |
Consider using enumerate instead of iterating with range and len Open
for i in range(len(candidate_array)):
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
TODO name_mode: str, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
i : i + pattern_length
- Read upRead up
- Exclude checks
TODO i : i + pattern_length ^ |
Wrong hanging indentation before block (add 4 spaces). Open
concat: bool = False,
- Read upRead up
- Exclude checks
TODO concat: bool = False, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
filter_langs: bool = False,
- Read upRead up
- Exclude checks
TODO filter_langs: bool = False, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
term: str,
- Read upRead up
- Exclude checks
TODO term: str, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
_LANG_DICT[_] for _ in BMDATA[name_mode]['languages']
- Read upRead up
- Exclude checks
TODO LANGDICT[_] for _ in BMDATA[name_mode]['languages'] ^ |
Wrong hanging indentation before block (add 4 spaces). Open
rules: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO rules: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
name_mode: str = 'gen',
- Read upRead up
- Exclude checks
TODO name_mode: str = 'gen', ^ |
Wrong hanging indentation before block (add 4 spaces). Open
final_rules1: Tuple[Any, ...],
- Read upRead up
- Exclude checks
TODO final_rules1: Tuple[Any, ...], ^ |
Wrong hanging indentation before block (add 4 spaces). Open
not found
- Read upRead up
- Exclude checks
TODO not found ^ |
Wrong hanging indentation before block (add 4 spaces). Open
strip: bool,
- Read upRead up
- Exclude checks
TODO strip: bool, ^ |
Wrong hanging indentation before block (add 4 spaces). Open
code & (code - 1)
- Read upRead up
- Exclude checks
TODO code & (code - 1) ^ |
Consider using enumerate instead of iterating with range and len Open
for i in range(len(alt_array)):
- Read upRead up
- Exclude checks
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)):
- Read upRead up
- Exclude checks
Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.