chrislit/abydos

View on GitHub

Showing 4,191 of 4,191 total issues

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

                and self._fn == other[3]
Severity: Info
Found in abydos/stats/_confusion_table.py by pylint

TODO and self._fn == other[3] ^ |

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

    def _isg_i(self, src: str, tar: str) -> float:
Severity: Critical
Found in abydos/distance/_isg.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

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

    def _alignment_matrix(
Severity: Critical
Found in abydos/distance/_levenshtein.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

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

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

TODO 'ende', ^ |

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

    def tokenize(self, string: str) -> 'QGrams':
Severity: Critical
Found in abydos/tokenizer/_q_grams.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

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

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

TODO 'erne', ^ |

TODO found
Open

    type,  # TODO: enumerate these when we add type hints for numpy scalars
Severity: Minor
Found in stubs/numpy/__init__.pyi by fixme

TODO found
Open

# TODO: add better annotations when ctypes is stubbed out
Severity: Minor
Found in stubs/numpy/core/_internal.pyi by fixme

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

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

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

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

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

TODO 'endes', ^ |

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

            and len(word) >= 2
Severity: Info
Found in abydos/stemmer/_snowball_danish.py by pylint

TODO and len(word) >= 2 ^ |

Method "__init__" has 8 parameters, which is greater than the 7 authorized.
Open

        self,
        alphabet: Optional[
            Union[TCounter[str], Sequence[str], Set[str], int]
        ] = None,
        tokenizer: Optional[_Tokenizer] = None,

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

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

    def corr(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

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

    def dist_abs(self, src: str, tar: str) -> float:
Severity: Critical
Found in abydos/distance/_editex.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:
    # ...

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

        self,
Severity: Info
Found in abydos/stats/_confusion_table.py by pylint

TODO self, ^ |

Unnecessary elif after return
Open

        if not precision or not recall:
Severity: Info
Found in abydos/stats/_confusion_table.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

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

TODO 'heden', ^ |

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

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

TODO 'ernes', ^ |

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

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

TODO 'eren', ^ |

Severity
Category
Status
Source
Language