Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 375 Bytes

File metadata and controls

18 lines (16 loc) · 375 Bytes

Decompose Conditional

Why?

  • You have a complex conditional logic.

Benefits:

  • The code is more readable and understandable.

What?

  • Decompose conditional by replacing each chunk of code with a function.

How?

  • Apply Extract Function on the condition.

Sample

Before

After refactoring