Sunday, May 22, 2011

Automated code analysis and refactoring

Here's another paper I found very practical:

This paper talks about automated identification of "code smells" and a semi-automated approach for fixing the smells with refactoring. 

Unfortunately the tools mentioned in the paper are for Java only, but it's a start. Hopefully i can find something similar for C++, and start applying it in my everyday development at work. 

It's actually funny to see the low tolerance the authors have for certain practices: 

"Many consider a cyclomatic complexity number of 10 or more to indicate an overly complex method" (p.4)

"A general rule of thumb I try to adhere to is to keep my methods to 20 lines of code or fewer. Of course, there may be exceptions to this rule, but if I've got methods over 20 lines, I want to know about" (p.8-9)

No comments:

Post a Comment