Code Review Toolbox

February 24th, 2009

Doing a code review is difficult for me. I don't always think of the design implications because I'm trying t hurry and get back to coding. I have mainly been checking for tests, and functionality. This needs to change and I think I've got some decent steps to help me make the leap, and use some tools to help illustrate my concerns to my coworkers.

Code Review Cheat Sheet
Great points on how to handle a code review without upsetting the developer of that code.
Flog
A 'golf' score for your code. Anytime code hurts my eyes, flog has a score that backs up my thoughts. Even without the developer knowing how things are being scored numbers seem to work for us.
Flay
Find violations of the dry principle and often fixing these issues can lower your flog score.
Roodi
Points out OO Design principle issues. I haven't used this much, but the few test runs I tried came up with some good suggestions. Really you should just check out the docs for all the things Roodi does.
Reek
Ruby code smell detector. Reek looks for a lot of common code smells and is easily configureable.

I hope that by bringing a new approach to code reviews I can improve our product, team morale, and the skills of everyone involved. I will keep you posted on how my toolbox works out. I'd also welcome any suggestions on source about improving code reviews and/or tools like the above that help focus where I need to spend the most time reviewing.

2 Responses to “Code Review Toolbox”

  1. Larry Marburger Says:

    I watched Bryan Liles actsas_conference 2009 talk and a good deal of it was describing why gathering metrics on your code is important. He touched quickly on flog, reek, rcov, roodi, integrity, and a few others. At the very end, though, he mentioned that metricfu is an all-in-one package that will run off of these and then some.

    To quote their site: It uses Saikuro, Flog, Flay, Rcov, Reek, Roodi, Subversion, Git, and Rails built-in stats task to create a series of reports.

    Unfortunately I can't speak from personal experience as I haven't had the opportunity to play with it, but I thought it'd be useful to mention it.

  2. Amos King Says:

    I tried metric_fu on our build for a while, but rcov would run out of memory before it could finish. I guess I could set it up to run everything except rcov.

Sorry, comments are closed for this article.