Added a code quality task to the scripts

and adjusted the code to pass it.