I have come across a good article which explains how to improve code quality
Poorly written code can be a real disaster. When the mess in your code increases, so does the time that it takes to maintain it. In the worst-case scenario, the code can no longer be maintained and the project will slowly die.
https://medium.com/better-programming/things-that-you-can-do-to-improve-code-quality-c746c30e7521