Automate fixes for issues found by Sonar

Currently there are no tools available for automatic fixing of sonarube bugs. There is walkmod, but it is only for trivial code-smells.

I am currently writing an automatic repair tool for sonarube bugs in java. It uses INRIA's spoon to fix the bugs. The github repo is sonarqube-repair. It has fixes for five bugs: rule numbers 1854, 1948, 2055, 2259 and 2095. I will update this answer once there is some significant progress.


I don't think I would want Sonar to change source. It's a code analyzer.

You could configure your IDE to format on save and do an initial format of all afflicted source files, so that it puts the satements on separate lines.

Also, you might want to review the importance of the problem and change/edit the Quality Profile.