Showing 4,191 of 4,191 total issues
Wrong hanging indentation before block (add 4 spaces). Open
'rr',
- Read upRead up
- Exclude checks
TODO 'rr', ^ |
Merge this if statement with the enclosing one. Open
if src_ln[1:2] == tar_ln[1:2] and (
- Read upRead up
- Exclude checks
Merging collapsible if
statements increases the code's readability.
Noncompliant Code Example
if condition1: if condition2: # ...
Compliant Solution
if condition1 and condition2: # ...
Refactor this function to reduce its Cognitive Complexity from 68 to the 15 allowed. Open
def sim(self, src: str, tar: str) -> float:
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed. Open
def sim(self, src: str, tar: str) -> float:
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Wrong hanging indentation before block (add 4 spaces). Open
self._tp == other.true_pos()
- Read upRead up
- Exclude checks
TODO self.tp == other.truepos() ^ |
Wrong hanging indentation before block (add 4 spaces). Open
'erens',
- Read upRead up
- Exclude checks
TODO 'erens', ^ |
Wrong hanging indentation before block (add 4 spaces). Open
'pp',
- Read upRead up
- Exclude checks
TODO 'pp', ^ |
Refactor this function to reduce its Cognitive Complexity from 47 to the 15 allowed. Open
def sim(self, src: str, tar: str) -> float:
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed. Open
def sim(self, src: str, tar: str) -> float:
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
TODO found Open
# TODO(shoyer): remove when all methods are defined
- Exclude checks
Unnecessary else
after return
Open
if len(nums) == 2:
- Read upRead up
- Exclude checks
Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.
Wrong hanging indentation before block (add 4 spaces). Open
tar_collection: Union[Sequence[str], Set[str]],
- Read upRead up
- Exclude checks
TODO tar_collection: Union[Sequence[str], Set[str]], ^ |
Consider using enumerate instead of iterating with range and len Open
for i in range(len(collection)):
- Read upRead up
- Exclude checks
Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.
Wrong hanging indentation before block (add 4 spaces). Open
and self._tn == other[1]
- Read upRead up
- Exclude checks
TODO and self._tn == other[1] ^ |
Wrong hanging indentation before block (add 4 spaces). Open
'ered',
- Read upRead up
- Exclude checks
TODO 'ered', ^ |
Wrong hanging indentation before block (add 4 spaces). Open
'erer',
- Read upRead up
- Exclude checks
TODO 'erer', ^ |
Wrong hanging indentation before block (add 4 spaces). Open
word[:-1]
- Read upRead up
- Exclude checks
TODO word[:-1] ^ |
Refactor this function to reduce its Cognitive Complexity from 88 to the 15 allowed. Open
def _synoname_word_approximation(
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Merge this if statement with the enclosing one. Open
if src_fn and tar_fn:
- Read upRead up
- Exclude checks
Merging collapsible if
statements increases the code's readability.
Noncompliant Code Example
if condition1: if condition2: # ...
Compliant Solution
if condition1 and condition2: # ...
Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed. Open
def dist_abs(self, src: str, tar: str) -> float:
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.