Showing 4,191 of 4,191 total issues
Function sim
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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 sim_score
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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
Avoid too many return
statements within this function. Open
Open
return word
Avoid too many return
statements within this function. Open
Open
return word, 92
Avoid too many return
statements within this function. Open
Open
return stemmed_word, rule_no
Avoid too many return
statements within this function. Open
Open
return word, 93
Avoid too many return
statements within this function. Open
Open
return word, 90.1
Avoid too many return
statements within this function. Open
Open
return word[:-1], 91.1
Avoid too many return
statements within this function. Open
Open
return word, 96
Avoid too many return
statements within this function. Open
Open
return word, 91
Avoid too many return
statements within this function. Open
Open
return word, 97
Avoid too many return
statements within this function. Open
Open
return word
Avoid too many return
statements within this function. Open
Open
return word
Avoid too many return
statements within this function. Open
Open
return sdx[: self._max_length]
Avoid too many return
statements within this function. Open
Open
return word, 90.2
Avoid too many return
statements within this function. Open
Open
return word, 96
Avoid too many return
statements within this function. Open
Open
return False
Avoid too many return
statements within this function. Open
Open
return len(nums) / sum(1.0 / float(i) for i in nums) # type: ignore
Avoid too many return
statements within this function. Open
Open
return word, 90.3
Avoid too many return
statements within this function. Open
Open
return word, 90