Scaling the Just Eat Help Centre on iOS
Article Summary
Andrea Scuderi from Just Eat reveals how his team tackled a 19,602-line legacy iOS module without a risky big-bang rewrite. Their 9-phase restructuring approach cut code by 23% while maintaining stability.
Just Eat's Help Centre module had become unmaintainable: massive view controllers, nested hierarchies, mixed storyboards and code, and a backend-driven UI with zero documentation. The team faced a critical decision: rewrite from scratch or refactor incrementally.
Key Takeaways
- Removed 23% of codebase by eliminating disabled features and unreachable code
- Achieved 85% code coverage by decoupling business logic into MVVM ViewModels
- Cut main app integration code by 56% with clear protocol boundaries
- Implemented Flow Coordinators with Chain of Responsibility for dynamic navigation
- Built record/replay mock server to keep UI tests synced with backend
The team transformed a legacy backend-driven UI module through 9 iterative phases, improving testability and maintainability without risking a complete rewrite.
About This Article
Just Eat's Help module had 32 UIKit view controllers and 14 UIViews with deeply nested hierarchies. Large classes like HelpFlowCoordinator reached 879 lines of code, making updates unpredictable and risky.
Andrea Scuderi's team rewrote all storyboards and XIBs as programmatic code, built MVVM architecture with Combine bindings, and used SonarQube and Emerge tools to measure cyclomatic complexity and code structure.
Code coverage reached 81% overall and 85% for view controllers. Cyclomatic complexity dropped through nine phases of systematic refactoring without needing a complete rewrite.