The chances are good that you have heard the phrase “Draw the line in the sand.” This line is the point you will not pass as to prevent worsening a situation. When dealing with code quality and craft, you will need to define that line, and the sooner, the better.
One example of such a line is “I will not increase the warning count to my code base.” With this small step, you are committing yourself that you will validate that you are not worsening your codebase by adding any code new violations.
The next step is to move line not outward but inward toward your goal. For removing of warnings, you can accomplish this setting a target of 5%, where you will actively remove that percentage of code violations each sprint. Keep that up each iteration, and the number of warnings gets smaller and smaller until you have no violations.
You were able to achieve your goal of zero warnings in your code base because you first defined that point you were not willing to pass. Take the challenge and draw that line!