Automatic code quality tool for Ruby? [closed]

2019-01-30 05:07发布

One thing I really miss about Java is the tool support. FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking.

Is there anything that will check for simple bugs and / or style violations of Ruby code? Bonus points if I can adapt it for frameworks such as Rails so that Rails idioms are adhered to.

9条回答
看我几分像从前
2楼-- · 2019-01-30 05:25

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.

查看更多
Evening l夕情丶
3楼-- · 2019-01-30 05:25

Projects I've found and tested recently:

查看更多
孤傲高冷的网名
4楼-- · 2019-01-30 05:32

I didn't see this questions when asked, but a blog post I did might help as well. In it I cover a bunch of Ruby tools and specifically cover 4 code quality tools...

  1. Roodi
  2. Dust
  3. Flog
  4. Saikuro

It might also be worth checking out Towelie and Flay

http://devver.wordpress.com/2008/10/03/ruby-tools-roundup/

Now we have combined a lot of tools into an only Ruby code quality and metrics monitoring tool called Caliper. This might fit your needs well. It tracks various quality metrics over the life of a project.

Caliper - improve your Ruby code

查看更多
霸刀☆藐视天下
5楼-- · 2019-01-30 05:34

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.

查看更多
小情绪 Triste *
6楼-- · 2019-01-30 05:36

Code Climate is a SaaS tool that integrates through git and automatically "grades" your code. It notifies you via various channels if there a sudden drop in quality. Nice UI as well.

查看更多
甜甜的少女心
7楼-- · 2019-01-30 05:37

You might want to try out RuboCop. It is a Ruby code style checker based on the Ruby Style Guide. It's maintained pretty actively and it's based on standard Ruby tooling (like the ripper library). It works well with Ruby 1.9 and 2.0 and has great Emacs integration. I hope you'll find it useful!

查看更多
登录 后发表回答