Find unused code in a Maven modularised project

前端 未结 2 909
甜味超标
甜味超标 2021-01-04 14:07

I have to clean up an old project and general knowledge here is that the project contains lots of unused code that we could remove. That would save some headaches and make m

2条回答
  •  Happy的楠姐
    2021-01-04 14:51

    I've used the Core Tools plugin to find unused code across many different maven modules. The build path for each of the projects has to be set up properly so that Eclipse knows that there are dependencies between projects. If you import the projects using the m2eclipse plugin, it will set these up automatically.

    I think the way that the Core Tools plugin works is that it automates the process that the "Call Hierarchy" view performs. Select a method and run "Call Hierarchy" (ctrl-alt-H) if there are no callers then Core Tools should mark the method as uncalled.

提交回复
热议问题