I started working at my current job just over a year ago. When I started the code base was a complete mess. All of the code was in one file, it was not maintainable and best practices were not considered. There was no separation of concerns, single responsibility principle, and some major best practices for the AngualrJS framework were ignored.
While working on it, I managed to pull the code into separate files and make it more manageable. However, when I bought the poor code quality up with my peers and my supervisor they were not supportive of refactoring it even though I could not really work with the code in its state. I did it anyway.
It turned out that before I started at least 4 different people had worked on the project. The person who wrote the code was very junior and was left to his own devices without any code reviews. The subsequent developers quit the role after 8 months each. One of my current coworkers did work on it for a short time but I am not sure what he did.
Every time I have brought up in the past that this code base is not following best practices my colleague has gotten very defensive, resistant and emotional. He even says things like 'oh well even though it's a mess at least it works'. He seemed to have his pride picked because I said a project was not in good form.
The problem is I am going on maternity leave in September and my difficult colleague will be covering for me while I am away for 6 months. I am concerned that he will not follow the best practices while I am away and I will come back to a mess again.
How can I address this with my supervisor? This company does not do code reviews, unit testing and code quality is not on the minds of supervisors.