Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-fixing pmd errors. Is it possible?

I just inherited a bunch of code from another developer and our company instituted some new code style rules. So now I have 300 pmd errors saying "Parameter 'blablahlblah' is not assigned and could be declared final". I really don't want to do all of these by hand and I just need to put a "final" modifier in front of every variable that is causing this pmd error. Is there any easy way to do this besides writing some script to consume the pmd output and modify the source files accordingly? I'm using IntelliJ, also. Maybe that can help me?

like image 254
ScottShamus Avatar asked Oct 21 '25 16:10

ScottShamus


1 Answers

Use Analyze | Inspect Code, it will give you the list of results grouped by inspection, quick fix can be often applied to the whole group of the results, so you can add final to all the places this inspection finds in one click.

like image 113
CrazyCoder Avatar answered Oct 23 '25 06:10

CrazyCoder