Showing 383 of 4,191 total issues
Avoid deeply nested control flow statements. Open
if _phonet_rules[pos] and (
'<' in cast(str, _phonet_rules[pos])[1:]
):
priority0 = 1
else:
Avoid deeply nested control flow statements. Open
if char == self._vowel_char:
if vowels:
code += char
vowels -= 1
else:
Avoid deeply nested control flow statements. Open
if accept:
break
Avoid deeply nested control flow statements. Open
if phonetic[i] == ']':
i += 1
phonetic2 += phonetic[attrib_start:i]
break
i += 1
Avoid deeply nested control flow statements. Open
for i in range(len(self._alpha_sis_basic[k])):
newalpha += [
_ + self._alpha_sis_basic[k][i] for _ in alpha
]
alpha = newalpha
Avoid deeply nested control flow statements. Open
if word[pos + 1 : pos + 2] in {'E', 'I'}:
meta_key += 'J'
pos += 2
# base case
else:
Avoid deeply nested control flow statements. Open
if roman:
if not any(
abbr in fname for abbr in ('i.', 'v.', 'x.')
):
full_name = (
Avoid deeply nested control flow statements. Open
if word[pos + 2 : pos + 3] in self._uc_vy_set:
code += 'C'
else: # CHR, CHL, etc.
code += 'K'
else:
Avoid deeply nested control flow statements. Open
if (
(current > 2)
and (_get_at(current - 1) == 'U')
and (
_string_at(
Avoid deeply nested control flow statements. Open
if (
(matches > 1)
and src[i + matches : i + matches + 1]
and (priority0 != ord('-'))
):
Avoid deeply nested control flow statements. Open
if (priority0 == 1) and (zeta == 0):
# rule with '<' is applied
if (
(j > 0)
and rule
Avoid deeply nested control flow statements. Open
if word[pos + 1 : pos + 2] == 'C':
meta_key += 'X'
pos += 2
# special case 'cesar', 'cien', 'cid', 'conciencia'
elif word[pos + 1 : pos + 2] in {'E', 'I'}:
Avoid deeply nested control flow statements. Open
if k <= 0:
# add hash value for all letters
if phonet_hash_1[j, 0] < 0:
phonet_hash_1[j, 0] = i
Function _sb_ends_in_short_syllable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _sb_ends_in_short_syllable(self, term: str) -> bool:
"""Return True iff term ends in a short syllable.
(...according to 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
Avoid deeply nested control flow statements. Open
if _is_vowel(pos + 1):
meta_key += word[pos + 1]
pos += 2
else:
meta_key += 'H'
Avoid deeply nested control flow statements. Open
if (
i == 0
and i + 1 < elen
and ename[i + 2 : i + 3] not in self._uc_v_set
):
Function _redo_language
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _redo_language(
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
Avoid deeply nested control flow statements. Open
if _get_at(current + 2) == 'I':
primary, secondary = _metaph_add('J')
else:
primary, secondary = _metaph_add('K')
current += 2
Function fingerprint
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fingerprint(self, word: str) -> str:
"""Return the extract - position & frequency coding.
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"