I’ve recently started looking for something like this for Ruby. What I’ve run across so far:
These might be places to start. Unfortunately I haven’t used any of the three enough yet to offer a good opinion.
Saikuro and Flog can be good for getting a basic idea of code complexity. You can also use a tool like rcov to look at your test coverage.
There is a plugin for Rails projects that combine all those metrics into a single rake task. It is called metric_fu.
Projects I’ve found and tested recently:
- Seems to work, and gives sensible warnings
- Works, but quite a few false positives
- I disagree with most of the warnings from this tool, but it works
- This requires ocaml; I haven’t tried it, but it looks like it might be good
- does not appear to be Ruby 1.9 compatible
- Is broken for me, and only catches name errors, so unit tests should cover that.
- Doesn’t compile for me