Showing 383 of 4,191 total issues
Avoid too many return
statements within this function. Open
return self._weights[5]
Avoid too many return
statements within this function. Open
return w_ratio
Avoid too many return
statements within this function. Open
return _fmt_retval(self._match_type_dict['punctuation'])
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 0.0
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return cast(float, d_mat[src_len, tar_len])
Avoid too many return
statements within this function. Open
return cast(float, d_mat[src_len, tar_len])
Avoid too many return
statements within this function. Open
return cast(float, d_mat[src_len, tar_len])
Avoid too many return
statements within this function. Open
return cast(
Function package_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def package_path(resource_name: str) -> str:
"""Given a resource name, returns the path to the package."""
for path in data_path:
for subdir in DATA_SUBDIRS:
check_path = os.path.join(path, subdir, resource_name)
- 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 _ncr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _ncr(n: float, r: float) -> float:
r"""Return n Choose r.
Cf. https://en.wikipedia.org/wiki/Combination
- 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 _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
Function dist_abs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dist_abs(self, src: str, tar: str) -> float:
"""Return the Shapira & Storer I edit distance between two strings.
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 fingerprint_int
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fingerprint_int(self, word: str) -> int:
"""Return the count fingerprint.
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 _tokenize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _tokenize(
self, src: Union[str, TCounter[str]], tar: Union[str, TCounter[str]]
) -> '_TokenDistance':
"""Return the Q-Grams in src & tar.
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
variant: int = 1,
doubles: bool = True,
vowels: Optional[Union[Iterable[str], str]] = None,
- 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 sim
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sim(self, src: str, tar: str) -> float:
"""Return the BLEU similarity of two strings.
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 dist_abs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dist_abs(self, src: str, tar: str) -> float:
"""Return the Ozbay metric.
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 dist_abs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dist_abs(self, src: str, tar: str) -> float:
"""Return Millar's binomial deviance dissimilarity of two strings.
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"