Showing 383 of 4,191 total issues
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 (
i == 0
and i + 1 < elen
and ename[i + 2 : i + 3] not in self._uc_v_set
):
Avoid deeply nested control flow statements. Open
if not (col_covered[col] | row_covered[row]):
break
else:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if not any(
abbr in fname for abbr in ('i.', 'v.', 'x.')
):
full_name = full_name[:loc]
toolcode[7] += '{:03d}'.format(num) + 'a'
Avoid deeply nested control flow statements. Open
for key, value in tar_feat[i].items():
if key != 'supplemental':
tar_feat[j][key] = value
j = 0
Avoid deeply nested control flow statements. Open
for key, value in src_feat[i].items():
if key != 'supplemental':
src_feat[j][key] = value
j = 0
Function corr
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def corr(self, src: str, tar: str) -> float:
"""Return the Hurlbert correlation 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 sim_matrix
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sim_matrix(
Avoid deeply nested control flow statements. Open
for row in range(n):
if (
not (row_covered[row])
and arr[row, col] < h_val
):
Avoid deeply nested control flow statements. Open
if backtrace:
trace_mat[i + 1, j + 1] = 2
if backtrace:
Avoid deeply nested control flow statements. Open
if (
abs(sp - tp) <= self._max_dist
and sp not in src_matched
and tp not in tar_matched
):
Avoid deeply nested control flow statements. Open
if not (col_covered[col] | row_covered[row]):
primed[row, col] = True
z_cols = (starred[row, :]).nonzero()[0]
if not z_cols.size:
step = 2
Avoid deeply nested control flow statements. Open
if i == src_len or j == tar_len:
sg_max = s_mat[i, j]
else:
Avoid deeply nested control flow statements. Open
if roman:
if not any(
abbr in fname for abbr in ('i.', 'v.', 'x.')
):
full_name = (
Function sim
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sim(self, src: str, tar: str) -> float:
"""Return the BI-SIM 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 decode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def decode(self, text: str) -> str:
r"""Perform decoding of run-length-encoding (RLE).
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 sim_score
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sim_score(self, src: str, tar: str) -> float:
"""Return the Morisita 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if backtrace:
trace_mat[i + 1, j + 1] = 2