eggplants/shindan-cli

View on GitHub

Showing 7 of 7 total issues

Function get_rbr has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def get_rbr(source: BeautifulSoup) -> str:
    """Get the result of the shindan from the source.

    Args:
    ----
Severity: Minor
Found in shindan_cli/interactive.py - About 1 hr 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

Function shindan has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def shindan(
    page_id: int,
    shindan_name: str,
    *,
    wait: bool | None = False,
Severity: Minor
Found in shindan_cli/shindan.py - About 1 hr 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

Function get_choices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def get_choices(source: BeautifulSoup) -> dict[int, str]:
    """Get the choices from the shindan source.

    Args:
    ----
Severity: Minor
Found in shindan_cli/interactive.py - About 1 hr 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

Function get_result_by_ai has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def get_result_by_ai(
Severity: Minor
Found in shindan_cli/get_results.py - About 45 mins to fix

    Function __get_result has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def __get_result(
    Severity: Minor
    Found in shindan_cli/get_results.py - About 35 mins to fix

      Function get_result_by_check has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def get_result_by_check(
      Severity: Minor
      Found in shindan_cli/get_results.py - About 35 mins to fix

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

        def get_user_inputs(
            source: BeautifulSoup,
            shindan_name: str,
        ) -> UserInputs:
            """Get user inputs from the shindan source.
        Severity: Minor
        Found in shindan_cli/interactive.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

        Severity
        Category
        Status
        Source
        Language