What would you do if you needed to implement a new feature in an existing application but the codebase is poorly documented?

Situational