Skip to content

Refactor code to address Sourcery-identified code quality issues #333

@sourcery-ai

Description

@sourcery-ai

Sourcery has identified several code quality issues in the codebase:

  1. Swap if/else to remove empty if body (x2):

    • There are two instances where an if statement has an empty body (e.g., just a pass), and the logic can be improved by swapping the if/else blocks to remove the empty body. See Sourcery documentation for more details.
  2. Hoist repeated code outside conditional statement (x2):

    • There are two instances where code is repeated in both branches of a conditional statement. This code should be hoisted outside the conditional to improve readability and maintainability. See Sourcery documentation for more details.

Action Items:

  • Refactor the code to address the above issues:
    • Swap if/else blocks to remove empty if bodies.
    • Hoist repeated code outside of conditional statements.
  • Review the affected files and ensure that the changes do not affect functionality.

Addressing these issues will improve code quality and maintainability.


I created this issue for @sjswerdloff from #328 (comment).

Tips and commands

Getting Help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions