This article detects and analyzes the code quality issues (CQIs) in students’ Java programs to discover what kinds of CQIs affect the students’ programming quality most frequently and provides possible solutions to fix such issues. We use a code quality detector named SonarQube to detect two thousand programs submitted by students in the past Java programming course. We generate the solutions based on the feedback of SonarQube and re-detect the programs after modifying them to verify the improvement of code quality. The result indicates the CQIs in students" programs are diverse and numerous. The solutions for fixing such issues are efficient. The result drives us to look forward to apply the code quality detection as a sub-function of an online judge to help students to improve their programming quality by themselves in the future.