For several checks, auto-fixers are available. By clicking the Fix all
button in the report (see Figure 3.15↓
), all violations for a specific (configuration of a) check are fixed. By clicking the Fix all in this file
button all violations for a specific (configuration of a) check in a checked file are fixed. There is also a Fix on this line
button, to fix individual violations. For this to work, the lines at which the violations were encountered should not have been edited between running the check and clicking the auto-fix link. Doing so might result in a warning. Similarly, fixing the same line twice will fix the violations the first time, and could trigger a warning on the second attempt. After a button has been clicked and its fix has been applied, the button will be disabled. This feature helps to keep track of the fix buttons that have been clicked previously, but they do not reflect the most up-to-date state of the code. After fixes have been applied, it is advised to run the check again to verify that the code now passes the check
. Automated fixes are not available from the Model Advisor.