talira

Code smell detector for Ruby

open sourceMITfree

Reek is a code smell detector for Ruby. It examines classes, modules and methods and reports smells such as Feature Envy, Data Clump, Long Parameter List, Large Class, Too Many Statements, Uncommunicative Name and Unused Parameters. It reads a configuration file to turn detectors on or off, can generate a todo file that suppresses the warnings a codebase already has, and ships a Rake task and RSpec matchers for running it in a build.

Problems it solves

  • find code smells like long parameter lists and feature envy in my Ruby code
  • add a code quality check for Ruby classes to CI
  • suppress existing code smell warnings in a large Ruby codebase and catch new ones

Features

  • detects code smells in Ruby classes, modules and methods
  • configuration file to enable, disable and tune detectors
  • --todo flag that suppresses a codebase's existing warnings
  • Rake task and RSpec matchers for CI
  • editor and git-hook integrations listed in its README

Limitations

  • Officially supported for CRuby 3.0 through 3.3 and JRuby 9.4.1

Alternatives

The same job

These do what Reek does.

  1. RuboCop A Ruby static code analyzer and formatter, based on the community Ruby style guide.
  2. RuboCop RSpec RuboCop extension with cops for RSpec test files
  3. RuboCop Rails RuboCop extension with cops for Rails best practices and conventions
  4. rubocop-require_tools RuboCop extension that flags missing require statements

Compare Reek with the top 3