Showing 383 of 4,191 total issues
Function _encode_next
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _encode_next(self, word: str) -> Tuple[str, str]:
if word[:3] == 'STI' and word[3:4] in {'E', 'Ä'}:
code = '*'
remainder = word[3:]
elif word[:3] in self._transforms[3]:
- 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 hmean
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def hmean(nums: Sequence[float]) -> float:
r"""Return harmonic mean.
The harmonic mean is defined as
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def fingerprint_int(self, word: str) -> int:
"""Return the occurrence halved fingerprint.
Based on the occurrence halved fingerprint from :cite:`Cislak:2017`.
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def sim(self, src: str, tar: str) -> float:
"""Return the Monge-Elkan 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 __init__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
max_offset: int = 5,
max_distance: int = 0,
tokenizer: Optional[_Tokenizer] = 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 12 (exceeds 5 allowed). Consider refactoring. Open
def sim(self, src: str, tar: str) -> float:
r"""Return the Soft Cosine 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
Consider simplifying this complex logical expression. Open
if word[:3] == 'STI' and word[3:4] in {'E', 'Ä'}:
code = '*'
remainder = word[3:]
elif word[:3] in self._transforms[3]:
code = self._transforms[3][word[:3]]
Consider simplifying this complex logical expression. Open
if pos >= 0:
# check rules for this char
while (_phonet_rules[pos] is None) or (
cast(str, _phonet_rules[pos])[0] == char
):
Function _sb_r1
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _sb_r1(
self, term: str, r1_prefixes: Optional[Iterable[str]] = None
) -> int:
"""Return the R1 region, as defined in the Porter2 specification.
- 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 _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 dist_abs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def dist_abs(self, src: str, tar: str) -> float:
"""Return the FlexMetric distance 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 lcsstr
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def lcsstr(self, src: str, tar: str) -> str:
"""Return the longest common substring of two strings.
Longest common substring (LCSstr).
- 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
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fingerprint(self, word: str) -> str:
"""Return the skeleton key.
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 _get_estimates
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _get_estimates(self, src: str, tar: str) -> Tuple[float, float]:
"""Get the estimates U-hat & V-hat used for Chao's measures.
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 get_feature
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_feature(vector: List[int], feature: str) -> List[Union[int, float]]:
"""Get a feature vector.
This returns a list of ints, equal in length to the vector input,
representing presence/absence/neutrality with respect to a particular
- 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 _scale_and_counterize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _scale_and_counterize(self) -> None:
"""Scale the tokens and store them in a defaultdict.
.. versionadded:: 0.6.0
- 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 decode
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def decode(self, code: str) -> str:
r"""Return a word decoded from BWT form.
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 encode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encode(self, word: str) -> str:
"""Return the Dolby Code of a name.
Parameters
----------
Function encode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encode(self, lname: str) -> str:
"""Calculate the PSHP Soundex/Viewex Coding of a last name.
Parameters
----------