Piranha: An Open Source Tool to Automatically Delete Stale Code @UberEngineering
Piranha: An Open Source Tool to Automatically Delete Stale Code  @UberEngineering
Uploaded March 2020 | Updated September 2026, 2 weeks ago
At Uber, we use feature flags to customize our mobile app execution, serving different features to different sets of users. However, after a feature has either been 100 percent rolled out to our users or an experimental feature has been deemed unsuccessful, the feature flag in the code becomes obsolete. These nonfunctional feature flags represent technical debt, making it difficult for developers to work on the codebase.

Seeking to automate this process, we developed Piranha, a tool that scans source code to delete code related to stale feature flags, leading to a cleaner, safer, more  performant, and more maintainable code base. We run Piranha at Uber in an ongoing pipeline for our Android and iOS codebases, and have used it to remove around two thousand stale feature flags and their related code.

We believe Piranha offers great utility for organizations that use feature flags in their app deployments, and so have open sourced it. Currently implemented for Objective-C, Swift, and Java programs, open source contributors may want to apply Piranha to other languages or improve on its ability to perform deep code refactorings.

Learn more: eng.uber.com/piranha

Check out the project for yourself: github.com/uber/piranha
Piranha: An Open Source Tool to Automatically Delete Stale CodeUber Tech Day: Were Better TogetherUber Tech Day: Flow, Uber’s IFTTT EngineUber Tech Day: Exploring the World Of Fleets[Uber Marketplace] Using Machine Learning to Power Uber Eats   Charlie ZhangUber Tech Day: From San Francisco to the World   Internalization/i18n at UberUber Tech Day: Payments at Uber[Uber Open Summit 2018] Closing Keynote with Zoubin Ghahramani, Chief Scientist, UberUber Tech Day: UQL Schema[Visualization Nights] Painting the World with Data - Erik Klimczak[Visualization Nights] Urban Planning Workshop with Kepler gl & Uber Movement[Distributed Tracing NYC] Gaining Insights from Distributed Traces   Joe Farro
Uber Engineering |

Piranha: An Open Source Tool to Automatically Delete Stale Code

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER