Showing 383 of 4,191 total issues
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
word_approx_min: float = 0.3,
char_approx_min: float = 0.73,
tests: Union[int, TIterable[str]] = 2 ** 12 - 1,
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dist(self, src: str, tar: str) -> float:
"""Return the average linkage 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 fingerprint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fingerprint(self, word: str) -> str:
"""Return the omission 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 fingerprint_int
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fingerprint_int(self, word: str) -> int:
"""Return the occurrence 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 sim_score
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sim_score(self, src: str, tar: str) -> float:
"""Return the Fellegi-Sunter 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 sim
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sim(self, src: str, tar: str) -> float:
"""Return the prefix similarity of two strings.
Prefix similarity is the ratio of the length of the shorter term that
exactly matches the longer term to the length of the shorter term,
- 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 alignment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def alignment(self, src: str, tar: str) -> Tuple[float, str, str]:
"""Return the Levenshtein alignment 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
Avoid too many return
statements within this function. Open
return word, 90
Avoid too many return
statements within this function. Open
return word, 90.1
Avoid too many return
statements within this function. Open
return word[:-1], 91.1
Avoid too many return
statements within this function. Open
return word, 96
Avoid too many return
statements within this function. Open
return word, 90.2
Avoid too many return
statements within this function. Open
return word, 91
Avoid too many return
statements within this function. Open
return word
Avoid too many return
statements within this function. Open
return word, 93
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return len(nums) / sum(1.0 / float(i) for i in nums) # type: ignore
Avoid too many return
statements within this function. Open
return word, 96
Avoid too many return
statements within this function. Open
return word
Avoid too many return
statements within this function. Open
return word, 90.3