add code quality harness and fixes