Just Eat Andrea Scuderi Dec 7, 2022

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

Critical Insight

The team transformed a legacy backend-driven UI module through 9 iterative phases, improving testability and maintainability without risking a complete rewrite.

The article details specific tools they used for code analysis and reveals why their Navigation Delegation pattern solved the unique challenges of dynamic, backend-driven navigation.

About This Article

Problem

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.

Solution

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.

Impact

Code coverage reached 81% overall and 85% for view controllers. Cyclomatic complexity dropped through nine phases of systematic refactoring without needing a complete rewrite.