Skip to content

Conversation

@JamesGai
Copy link

@JamesGai JamesGai commented Jun 1, 2025

Why refactor?

  1. Nested conditional statements (if)
  2. Duplication (same logics for checking invoice types)
  3. Lack of message indicators
  4. Low readability and huge function

How to refactor?

  1. Break the nested statements into separate helper functions so that function won't get too large
  2. Replace duplicated invvoice checking logic with single conditional statement
  3. Able to write individual test cases for these helper functions for long-term usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant