In 2022, for a huge #Perl project, I spent an entire week understanding, debugging, testing, and refactoring a massive chunk of very badly written code. By the time I was done, it was much cleaner and easier to understand.
With that, I made a major discovery. The code wasn't used. I could have simply deleted it.