Solving bad smells

Last week I took some time to checkout the JDeodorant Eclipse plugin. The plugin was introduced to me at CSMR 2009 by Nikolaos Tsantalis. The demo he gave me already showed some potential, and playing around with the plugin confirmed this first impression.

Installing the plugin was easy, I just followed the installation instructions on the website. At first I used the tool on one of our smaller projects to find refactorings for long methods. After some minutes the results showed a long list of refactor-candidates. Unfortunately, this lists also contained many propositions to move, for example, all statements of a method to a new method. Even though it is a theoretically correct proposition it does not really make sense in general.

Since I did not feel like analyzing the complete list I tried a different approach. I first used checkstyle to find potential candidate methods and let JDeodorant analyze these files one at a time. This does not only speed up the process of finding the candidates, it also provides a list that is way easier to handle. Using this approach I found some new ideas for a several smaller refactorings in just a few minutes.

In the end I think that, even though it still has some rough edges, this plugin can be very useful. Anyway, the plugin is definitely put onto my watch list.