I’ve inherited 200K lines of spaghetti code — what now?
I'm dealing with legacy code. It contains some BIG classes (line count 8000+) and some BIG methods (line count 3000+). For one of these methods I wrote a unit test that covers at least some code. This function has no specific structure, it is a mess of nested loops and conditions. I'd like to refactor but still I have no idea how to start.
I actually started by extracting one single function. In the end it had to have 21 parameters :-/
Should I ...
1. continue extracting awful functions knowing that in the long run I will succeed?
2. start extracting even bigger functions? So I expose the structure of this monster and then I can start the real refactoring.
3. only extract small "good" functions (and / or classes) just because I am a helluva clean coder?
4. do something completely different?