>>105972695 (OP)When it becomes unmaintainable. As long as your software is easy to maintain, you can just cut out the bloat and dust off the existing code. If your code is an unmaintainable mess, you may as well start from scratch. Maintainability is everything when it comes to the longevity of software. You have to keep on top of your tech debt.
t. dev stuck 5 years into reviving a project buried in tech debt that the company refuses to rebuild (we still don't have a minimum viable product)