Skip to content
CAI
Software that uses CAICheck a score

troessner/reek

68.7

Adequate · 28 September 2026

10.9k

lines of production code

Ruby

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Reek is a static code analysis tool for Ruby that detects code smells and enforces coding standards. It provides a command-line interface and Rake task integration to analyze source files, supporting multiple output formats including JSON, YAML, and Code Climate reports. The system allows for granular configuration via YAML files and source code comments, enabling users to customize detection rules and exclusions.

How it got here

2008–2009 — Architecture rewrite and modernization

16 changes.

This period focused on a complete rewrite of Reek's core analysis engine, replacing legacy checkers with a context-based Examiner and modernizing the public API. The project simultaneously modernized its infrastructure by upgrading to Ruby 3.2+, migrating to RSpec 3, and integrating Code Climate support while removing obsolete build tools and legacy documentation.

2010–2015 — CLI and AST refactoring

19 changes.

This period focused on a comprehensive architectural overhaul of Reek, replacing the legacy Sexp-based AST with a modern parser gem integration and restructuring the context hierarchy for better visibility tracking. The command-line interface was significantly refactored to support multiple output formats, granular configuration via dry-schema, and seamless Rake task integration. These changes were accompanied by extensive test coverage to ensure stability across the new reporting, configuration, and source analysis subsystems.

2016–2023 — Architecture modularization and integration

11 changes.

This period focused on refactoring Reek's core architecture by introducing a modular Command pattern for the CLI and a shared BaseDetector for smell analysis, significantly improving extensibility and code consistency. The work also expanded the tool's ecosystem by adding Code Climate integration and enhanced the user experience through stricter validation and clearer error reporting for configuration and source code issues.

Features

Added Code Climate integration and modernized CLI entry points

A new \bin/code\_climate\_reek\ script has been added to support Code Climate integration, allowing users to configure analysis via a \config.json\ file (including \include\_paths\ and \target\_ruby\_version\) and ensuring exit codes conform to Code Climate's requirements. The main \bin/reek\ entry point has been refactored to use the new \Reek::CLI::Application\ class, replacing the previous manual file scanning and analysis logic with a standardized CLI execution flow.

bin · high confidence

Added sample files for configuration and source analysis

This change introduces a comprehensive set of sample files to support testing and demonstration of the tool's configuration and analysis capabilities. It includes various YAML configuration examples in the \samples/configuration\ directory, demonstrating how to set up detector exclusions, accepts/rejects lists, and directory-specific rules. Additionally, it adds sample Ruby source files (both clean and smelly) in \samples/clean\_source\ and \samples/smelly\_source\, along with specific test fixtures like \samples/source\_with\_exclude\_paths\ and \samples/source\_with\_hidden\_directories\ to verify path exclusion and hidden file handling. A \samples/checkstyle.xml\ file is also added to show expected output for a specific source file. Finally, some older sample files under \samples/optparse\ have been removed or reorganized.

samples · high confidence

Initial project scaffolding and configuration

The repository has been initialized with a complete project structure, including a Dockerfile for Code Climate integration, a Rakefile with a CI task, and configuration files for RuboCop, SimpleCov, and YARD. Documentation has been added via a new README, contributing guidelines, and a changelog, while legacy files like History.txt and setup.rb have been removed.

(repo-wide) · high confidence

New Code Climate integration for reporting smells

Reek now supports outputting analysis results in the Code Climate engine format. This change introduces a new \CodeClimateReport\ class and associated components (\CodeClimateFormatter\, \CodeClimateFingerprint\, and \CodeClimateConfiguration\) that transform Reek's internal warning data into the specific JSON structure required by the Code Climate platform, including unique fingerprints and remediation points defined in a new configuration YAML file.

_lib/reek/code\climate · high confidence

New Rake task for running Reek code analysis

A new \Reek::Rake::Task\ class is introduced, allowing users to integrate Reek into their Rake build pipelines. This task defaults to checking \lib/\\/\*.rb\ but supports configuration via environment variables (\REEK\_CFG\, \REEK\_SRC\, \REEK\_OPTS\) and task attributes (e.g., \config\_file\, \source\_files\, \fail\_on\_error\). Users can now run \rake reek\ to check for code smells, with options to customize the source file list, pass command-line arguments to Reek, and control whether the build fails on detected issues.

lib/reek/rake · high confidence

New configuration options for fine-grained smell control and validation

Reek now supports \accept\ and \reject\ settings for detectors like \UncommunicativeMethodName\, allowing users to include or exclude specific names or regex patterns from reports. Directory-specific directives can be defined under a new \directories\ key to override detector settings per path, and \exclude\_paths\ allows ignoring entire file paths. A new \--show-configuration-path\ flag helps users identify which config file is active, and configuration files are now validated against a schema to prevent errors from invalid settings.

_features/configuration\files · high confidence

New machine-readable report formats and enhanced CLI output options

Users can now export smell reports in structured JSON and YAML formats using the --format json or --format yaml flags, enabling easier integration with other tools. The default text report has also been enhanced with a --single-line option for concise output, configurable line numbers, and the ability to sort files by issue count. Additionally, the --documentation flag provides direct links to help documentation for each detected smell.

features/reports · high confidence

Removals

Removal of legacy Hoe-based build configuration files

The project has removed the \config/hoe.rb\ and \config/requirements.rb\ files, which previously handled gem metadata, RubyForge integration, and dependency loading for the Hoe build system. This change eliminates the reliance on the Hoe gem and associated Rakefile configurations for project setup and publishing.

config · high confidence

Removal of legacy script helpers and generators

The \script/destroy\, \script/generate\, and \script/txt2html\ executable scripts (along with their Windows \.cmd\ wrappers) have been removed. This eliminates the legacy RubiGen-based code generation commands and the custom text-to-HTML conversion utility, indicating a shift away from these specific tooling workflows.

script · high confidence

Removed the legacy static website

The project has deleted the old website files (including \index.html\, \index.txt\, \template.rhtml\, \screen.css\, and \rounded\_corners\_lite.inc.js\). This removes the previous static site hosted on Rubyforge, which is consistent with the project's move to redirect users to GitHub.

website · high confidence

Architecture

Refactor CLI into a modular Command pattern

The CLI structure has been refactored to use a Command pattern, introducing a new \BaseCommand\ class and specific command implementations (\ReportCommand\, \TodoListCommand\) in \lib/reek/cli/command\. This change separates the concerns of collecting smells and generating reports or TODO lists, making the CLI logic more modular and maintainable. Users will see no immediate functional change, but the underlying architecture is now more extensible for future features.

lib/reek/cli/command · high confidence

Behavioural changes

Improved error reporting for configuration and source parsing issues

Reek now provides more specific and actionable error messages when it encounters problems with source code comments or file parsing. If you use an unknown detector, an invalid configuration key, or the legacy comment format (three colons), you will receive a clear error explaining the issue and linking to documentation. Additionally, syntax errors and encoding issues in source files now include the original exception details and backtrace to help you diagnose and fix the underlying problem.

lib/reek/errors · high confidence

Improved validation and error reporting for source code comment configurations

Reek now provides clearer, more specific error messages when source code comments contain invalid configurations, such as unknown smell detector names, malformed option structures, or unrecognized configuration keys. Instead of crashing or silently ignoring these issues, the tool explicitly reports the nature of the error (e.g., 'unknown smell detector', 'cannot parse the configuration', 'unknown option') along with the source file and line number, allowing users to quickly identify and fix misconfigurations in their code comments.

_features/configuration\_via\_source\comments · high confidence

Introduce SourceCode and SourceLocator modules for parsing and file discovery

The library now uses a dedicated SourceCode class to handle Ruby source analysis, supporting input from files, IO streams (like STDIN), and strings, while automatically detecting the origin and ensuring UTF-8 encoding. A new SourceLocator class manages file discovery, traversing directories to find Ruby files while respecting configuration-based exclusions and ignoring hidden directories.

lib/reek/source · high confidence

Rake task infrastructure reorganized and modernized

The project's Rake task structure has been significantly reorganized to modernize the development workflow. Legacy tasks for deployment, website generation, and sample execution have been removed, while the testing suite has been consolidated into a unified 'test' namespace (covering specs, performance, quality, and Cucumber features). New tasks have been introduced to support RuboCop integration, an interactive console, and automatic regeneration of the default smell configuration file.

tasks · high confidence

Reek 6.5.0: Complete rewrite of the analysis engine and public API

Reek has been upgraded to version 6.5.0, introducing a complete rewrite of its internal architecture and public API. The legacy \Checker\ and \Smells\ classes have been removed and replaced by a new \Examiner\ that utilizes a \ContextBuilder\ to traverse the AST and a \DetectorRepository\ to manage smell detection. This change modernizes the public interface, making \Examiner\ the primary entry point for programmatic analysis and introducing new configuration structures like \SmellConfiguration\ and \CodeCommentValidator\ for handling inline code comments. The reporting system has also been refactored into a modular \Report\ module with distinct formatters for YAML, JSON, HTML, XML, and GitHub formats.

lib/reek · high confidence

Reek configuration now uses dry-schema validation and supports directory-specific smell directives

Reek's configuration loading has been refactored to use the dry-schema library for validation, replacing the previous kwalify-based approach. This change introduces stricter schema enforcement for configuration files, ensuring that detector settings and directory-specific directives are correctly structured. Users can now configure smell detectors on a per-directory basis using the new \directories\ key in their \.reek.yml\ files, allowing for granular control over which smells are enabled or excluded in specific parts of their codebase. Additionally, the configuration file finder now strictly looks for \.reek.yml\ files, and glob patterns in directory paths are supported for more flexible matching.

lib/reek/configuration · high confidence

Refactored AST node architecture and added Ruby 2.3+ syntax support

The AST layer has been restructured to replace the legacy Sexp-based node hierarchy with a new AST::Node class that extends the parser gem's AST::Node, improving stability and maintainability. This change introduces a dynamic class map (ASTNodeClassMap) to attach specific utility modules (SexpExtensions) to node types on demand. Additionally, the parser builder now includes a workaround for handling strings with invalid UTF-8 escape sequences, and new extensions support Ruby 2.3+ syntax features such as lambda literals, singleton methods defined via class \<\< self, and constant assignment syntax.

lib/reek/ast · high confidence

Refactored AST sexp extensions into modular node-specific files

The AST sexp extensions have been restructured from a single monolithic file into separate, modular files (e.g., arguments.rb, methods.rb, module.rb) organized by node type. This change introduces specific utility modules for handling Ruby 3.0+ syntax features, including \Forward\_ArgsNode\ and \KwnilargNode\ for argument forwarding, \LambdaNode\ for the new lambda literal syntax, and \CSendNode\ for safe navigation. It also adds support for \Data.define\ in \SendNode\ and \CasgnNode\ to correctly identify classes created via \Data.define\, and refactors \ModuleNode\ and \ClassNode\ to better handle constant definitions and superclass detection.

_lib/reek/ast/sexp\extensions · high confidence

Refactored ControlParameter smell detection logic

The ControlParameter smell detector has been refactored to improve accuracy and maintainability by extracting helper classes. A new CallInConditionFinder now correctly identifies legitimate uses of parameters in method calls within conditions (e.g., \if charlie(bravo)\), preventing false positives. The ControlParameterFinder logic has been restructured to use these helpers, ensuring that parameters used in the method body or in non-control-flow contexts are not flagged. This change refines how the tool distinguishes between actual control-parameter smells and valid parameter usage.

_lib/reek/smell\_detectors/control\_parameter\helpers · high confidence

Refactored context hierarchy to improve visibility tracking and nested class handling

The context analysis engine has been restructured to better handle Ruby's visibility modifiers and nested code structures. A new \VisibilityTracker\ class now explicitly manages public, private, protected, and module\_function states, ensuring that visibility changes correctly propagate to child methods and attributes. The context tree has been split into specialized classes (e.g., \MethodContext\, \AttributeContext\, \SingletonMethodContext\) to accurately distinguish between instance and singleton methods, which fixes previous issues with nested dynamic classes and refinements. Additionally, statement counting is now handled by a dedicated \StatementCounter\ object, and the root context has been renamed from \StopContext\ to \RootContext\ to better reflect its role in the AST traversal.

lib/reek/context · high confidence

Refactored report generation with new formatters and output formats

The report generation system has been restructured to support multiple output formats and improved progress tracking. A new base report class standardizes the handling of examiners and smells, enabling specific formatters for Text, JSON, YAML, XML, HTML, and GitHub Workflow commands. The text report now includes a progress formatter that displays status dots for each file during inspection, which can be suppressed for piped output. Additionally, warning messages can now include links to documentation, and location formatting has been refined to sort line numbers and support single-line or blank displays.

lib/reek/report · high confidence

Refined CLI behavior and new reporting options

The command-line interface now includes several behavioral updates and new options to improve usability and integration. Progress reporting is now disabled by default when output is piped, and a new --no-progress flag allows users to explicitly suppress progress indicators. Users can now control exit codes via --success-exit-code and --failure-exit-code, and can filter specific smells using the --smell option. The output format has been enhanced with a --single-line option for editor-compatible reporting, and the total number of warnings is now displayed when inspecting multiple files. Additionally, support for reading from stdin with --stdin-filename allows for better configuration matching in pipeline scenarios.

_features/command\_line\interface · high confidence

Reorganized CLI entry point and options parsing

The command-line interface has been refactored to improve structure and reliability. The main entry point is now the \CLI::Application\ class, which centralizes configuration loading, source detection, and command dispatch (reporting vs. todo list generation). A new \CLI::Options\ class handles argument parsing, introducing support for specific report formats (HTML, YAML, JSON, XML, GitHub), the \--todo\ flag for generating todo lists, and the \--stdin-filename\ option for piped input. Additionally, a \CLI::Silencer\ module was added to safely suppress warnings and capture standard output/error during execution, and exit codes are now defined in a dedicated \CLI::Status\ module.

lib/reek/cli · high confidence

Replaced legacy analysis engine with context-based examiner

The library has undergone a complete rewrite of its core analysis mechanism, removing the old \BlockChecker\ and \ClassChecker\ classes in favor of a new \Examiner\ that uses contexts as a scoping mechanism. This change removes the dependency on the \parse\_tree\ gem and \SexpProcessor\, replacing the previous \analyse\ method with a modernized API that includes default configuration constants and supports reading source code from stdin. Users will now interact with a refactored public API that is more robust and aligned with current Ruby standards.

lib · high confidence

Smell detectors refactored to use a shared BaseDetector

The smell detectors in lib/reek/smell\_detectors have been restructured to inherit from a new BaseDetector class, which centralizes configuration handling, context matching, and smell warning generation. This change standardizes how detectors access configuration, manage exclusions, and report issues, resulting in cleaner detector implementations and more consistent behavior across the suite.

_lib/reek/smell\detectors · high confidence

Test coverage

Added Reek source code quality tests; Added comprehensive test coverage for Reek smell detectors; Added comprehensive test coverage for the new Reek architecture; Added performance test for Reek runtime speed; Added test coverage for AST node traversal, formatting, and reference tracking; Added test coverage for CLI report and todo-list commands; Added test coverage for context classes and statement counter; Added test coverage for the configuration subsystem; Added tests for CLI application, options, and silencer; Added tests for Code Climate integration components; Added tests for RSpec matchers and smell matching logic; Added tests for report formatters and output behaviors; Added tests for the Rake task configuration and execution; Modernized test infrastructure and added helper utilities; New Cucumber step definitions for CLI and sample file testing; New RSpec matchers for testing code smells; New integration tests for configuration loading and locale handling; Rake task integration tests now verify environment variable overrides and FileList support; Standardize Cucumber test environment with Aruba integration.

Dependencies

Reek 5.0.0: Ruby 3.2+ requirement and dependency modernization

This release updates the gemspec and Gemfile to require Ruby 3.2.0 or higher, dropping support for older Ruby versions. It modernizes runtime dependencies by pinning \dry-schema\ to \~\> 1.13, \parser\ to \~\> 3.3.0, \rainbow\ to \~\> 3.0, and \rexml\ to \~\> 3.1, while adding an explicit dependency on \logger\ \~\> 1.6. Development dependencies are also updated, including \rubocop\ to \~\> 1.90, \rubocop-rspec\ to \~\> 3.10, \cucumber\ to \>= 10.0, and \aruba\ to \~\> 2.3.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 70 → 69 (-1.7)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (-0.0)
  • Architecture 100 → 72 (-28.0)
  • Maturity 64 → 64 (+0.0)
  • Readiness 66 → 67 (+1.3)
  • Security 76 → 81 (+4.8)

Resolved (6)

  • Documentation: no contributor guidance (README.md)
  • Documentation: no installation or build instructions
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (10)

  • Inconsistent naming for AST traversal/filtering methods. Node uses each_node, while specific node types use body_nodes. Additionally, CodeContext uses local_nodes. The parameter names also vary (target_types vs type vs types and ignoring vs ignored).
  • Inconsistent naming for similar concepts. ModuleNodeBase has name(), but ClassNode and CasgnNode have superclass(). While these are different concepts, ClassNode and CasgnNode both have superclass() and name(), which is consistent. However, ModuleNodeBase does not have superclass(), which is correct. The inconsistency is minor but CasgnNode duplicates superclass() from ClassNode if they share a base.
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion
  • Redundant method definitions. BlockargNode defines block? which is already defined in ArgNodeBase.
  • Redundant method definitions. ConstNode defines simple_name which is already defined in ConstantDefiningNodeBase.
  • Redundant method definitions. DefNode and DefsNode both define depends_on_instance?. If they share a common base, this should be defined there.
  • Redundant method definitions. DefNode and DefsNode define full_name which is already defined in ConstantDefiningNodeBase (assuming inheritance hierarchy implies this, or they are duplicating logic). Even if not direct inheritance, the signature and intent are identical across multiple distinct node types that likely share a common base or mixin.
  • Redundant method definitions. OptargNode and KwoptargNode define optional_argument? which is already defined in their parent ArgNodeBase. This creates unnecessary duplication in the public API surface.
  • Redundant method definitions. RestargNode, KwrestargNode, Forward_ArgsNode, Forward_ArgNode, and KwnilargNode all define anonymous_splat? which is already defined in ArgNodeBase. This duplicates the public API surface unnecessarily.

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • (repo) — 1 commit

Notable commits

  • change: Merge pull request #1843 from troessner/loosen-rubocop-dependencies

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

troessner/reek was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 8729696580154b0d05d068825cffd444426ae1dc — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.