Showing 29 of 29 total issues

Function filter_out_grammar_error has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def filter_out_grammar_error(self, warning: GrammalecteMessage) -> bool:
        """Return True when grammalecte error should be ignored."""
        if not isinstance(warning, GrammalecteGrammarMessage):
            return False
        if warning.rule in (
Severity: Minor
Found in padpo/checkers/grammalecte.py - About 35 mins to fix

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 False
Severity: Major
Found in padpo/checkers/grammalecte.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return True
    Severity: Major
    Found in padpo/checkers/grammalecte.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return True
      Severity: Major
      Found in padpo/checkers/grammalecte.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return True
        Severity: Major
        Found in padpo/checkers/grammalecte.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return False
          Severity: Major
          Found in padpo/checkers/grammalecte.py - About 30 mins to fix

            Function filter_out_spelling_error has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def filter_out_spelling_error(self, warning: GrammalecteMessage) -> bool:
                    """Return True when grammalecte error should be ignored."""
                    if not isinstance(warning, GrammalecteSpellingMessage):
                        return False
                    if set(warning.word) == {"x"}:
            Severity: Minor
            Found in padpo/checkers/grammalecte.py - About 25 mins to fix

            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

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

                def check_item(self, item: PoItem):
            Severity: Critical
            Found in padpo/checkers/glossary.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 16 to the 15 allowed.
            Open

            def main():
            Severity: Critical
            Found in padpo/padpo.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

            Severity
            Category
            Status
            Source
            Language