chrislit/abydos

View on GitHub

Showing 4,191 of 4,191 total issues

Merge this if statement with the enclosing one.
Open

                    if (

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 30 to the 15 allowed.
Open

    def _alignment_matrix(

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

_DtypeLikeNested = Any  # TODO: wait for support for recursive types
Severity: Minor
Found in stubs/numpy/__init__.pyi by fixme

Wrong hanging indentation before block (add 4 spaces).
Open

    ddof: int = 0,
Severity: Info
Found in abydos/stats/_mean.py by pylint

TODO ddof: int = 0, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

                and self._tn == other['tn']
Severity: Info
Found in abydos/stats/_confusion_table.py by pylint

TODO and self._tn == other['tn'] ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

                ending in self._suffix
Severity: Info
Found in abydos/stemmer/_lovins.py by pylint

TODO ending in self._suffix ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

            'll',
Severity: Info
Found in abydos/stemmer/_lovins.py by pylint

TODO 'll', ^ |

Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
Open

    def _cost(self, src: str, s_pos: int, tar: str, t_pos: int) -> float:
Severity: Critical
Found in abydos/distance/_flexmetric.py by sonar-python

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 (

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

Remove those useless parentheses.
Open

        return ((a + d) - ((a + b) * (a + c) + (c + d) * (b + d))) / (
Severity: Major
Found in abydos/distance/_gini_ii.py by sonar-python

The use of parentheses, even those not required to enforce a desired order of operations, can clarify the intent behind a piece of code. But redundant pairs of parentheses could be misleading, and should be removed.

Noncompliant Code Example

return ((3))        # Noncompliant
return ((x + 1))    # Noncompliant
x = ((y / 2)) + 1   # Noncompliant

Compliant Solution

return 3
return (3)
return x + 1
return (x + 1)
x = y / 2 + 1
x = (y / 2) + 1

Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
Open

    def tokenize(self, string: str) -> 'COrVClusterTokenizer':

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: add a protocol for anything with a dtype attribute
Severity: Minor
Found in stubs/numpy/__init__.pyi by fixme

Unnecessary elif after return
Open

    if nums[0] <= 0 or nums[1] <= 0:
Severity: Info
Found in abydos/stats/_mean.py by pylint

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

    symmetric: bool = False,
Severity: Info
Found in abydos/stats/_pairwise.py by pylint

TODO symmetric: bool = False, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

            'heds',
Severity: Info
Found in abydos/stemmer/_snowball_danish.py by pylint

TODO 'heds', ^ |

Too few public methods (1/2)
Open

class Porter(_Stemmer):
Severity: Info
Found in abydos/stemmer/_porter.py by pylint

Used when class has too few public methods, so be sure it's really worth it.

Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed.
Open

    def dist_abs(self, src: str, tar: str) -> float:

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

        m_h, prec
Severity: Info
Found in abydos/stats/_mean.py by pylint

TODO m_h, prec ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

    mean_func: Callable[[Sequence[float]], float] = amean,
Severity: Info
Found in abydos/stats/_mean.py by pylint

TODO mean_func: Callable[[Sequence[float]], float] = amean, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        tp: Union[
Severity: Info
Found in abydos/stats/_confusion_table.py by pylint

TODO tp: Union[ ^ |

Severity
Category
Status
Source
Language