Sounds like you were just reviewing bad code.
The author should have provided context via comments and structured the code in a way that is easy to change and understand