I'm working on a project which has a codebase of about 3500 files probably a few hundred less than that actually. This project is made in PHP and is a quite messy, in this case it means that the documentation is hard to understand OOP and procedural programming is mixed, dependecies are unclear and the ones who made the system where beginner programmers with all that that entails.
To be honest what they have done is impressive, it is a working product and all that. But debugging and adding new features is a real chore.
Now to my question what are some good criteria for wheter we should refactor the whole project or do a complete rewrite. I should mention that rewriting parts of the system as we go is probably a no go because of everything being interdependet.