troessner/reek
68.9
Adequate · 26 October 2026
10.9k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Reek is a static code analysis tool for Ruby that detects code smells and enforces quality standards. It provides a command-line interface and Rake task integration to scan source files, offering granular configuration via YAML files and source code comments. The system supports multiple output formats, including JSON, YAML, and Code Climate, to facilitate integration into CI/CD pipelines.
How it got here
2008–2009 — Core engine rewrite and modernization
17 changes.
The project underwent a fundamental architectural overhaul, replacing the legacy Sexp-based analysis engine with a modern, context-based Examiner and AST traversal system. This period also involved modernizing the CLI, updating dependencies to require Ruby 3.2+, and establishing a robust test infrastructure using RSpec and Cucumber to support the new architecture.
2010–2015 — CLI and AST refactoring
19 changes.
This period focused on a comprehensive refactoring of Reek's core architecture, introducing a unified SourceCode class and restructuring the AST layer to support modern Ruby syntax and improved parsing stability. The command-line interface was significantly enhanced with new reporting formats, granular configuration options, and better CI/CD integration capabilities. Extensive test coverage was added to validate the new context handling, configuration schema validation, and multi-format report generation.
2016–2023 — Architecture modularization and Code Climate integration
11 changes.
This period focused on refactoring the CLI and smell detectors into modular, extensible structures using Command and BaseDetector patterns. It also introduced Code Climate integration for reporting and significantly improved error handling and validation for configuration issues. Comprehensive test coverage was added across these new components and existing detectors to ensure stability.
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
Introduce SourceCode class for unified source representation and parsing
A new SourceCode class has been added to lib/reek/source to serve as the central representation for Ruby source code. It standardizes how source is ingested from files, Pathnames, IO streams (like STDIN), or raw strings, automatically determining the origin. The class handles encoding normalization to UTF-8 and manages the parsing process using the 'parser' gem, producing an Abstract Syntax Tree (AST) adorned with comments via TreeDresser. This change consolidates source handling logic, replacing previous ad-hoc approaches with a single, configurable entry point for code analysis.
lib/reek/source · 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
New CLI options parser and configurable exit codes
The CLI now uses a dedicated \Options\ class to manage command-line arguments, introducing several new capabilities for users. You can now generate a todo list of smells using the \--todo\ flag, restrict analysis to specific smells with \--smell\, and pass a filename for piped input via \--stdin-filename\. Report output supports additional formats including JSON, YAML, XML (Checkstyle), and GitHub annotations via \--format\. Configuration and behavior are further refined with flags to show the configuration path (\--show-configuration-path\), force exclusion rules (\--force-exclusion\), and control progress display (\--progress\). Additionally, exit codes for success and failure are now configurable, allowing integration tools to handle Reek's return status more flexibly.
lib/reek/cli · 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.6.0: Complete rewrite of the analysis engine and reporting system
This release upgrades Reek to version 6.6.0 and introduces a fundamental architectural shift from the legacy \Checker\/\Smell\ classes to a modern, context-based analysis engine. The new \Examiner\ orchestrates the scan using a \ContextBuilder\ to traverse the AST and a \DetectorRepository\ to apply smell detectors, replacing the old \SexpProcessor\-based approach. This change brings improved scoping, better handling of instance variables and method calls, and a more robust configuration system via \CodeComment\ validation. Additionally, the reporting layer has been completely overhauled to support multiple output formats (YAML, JSON, HTML, XML, Text, GitHub) and customizable formatters for headings, locations, and progress, providing users with more flexible and detailed code quality reports.
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
Reek v4.0.0: Major internal refactoring and new detection capabilities
This release introduces a significant architectural overhaul of Reek's internal structure, replacing the legacy Sexp-based AST nodes with a new \Reek::AST::Node\ class and introducing a \TreeDresser\ to enhance syntax trees with type-dependent mixins. The CLI has been reorganized into a dedicated \Application\ class, and configuration handling is now managed via \SmellConfiguration\ and \Overrides\ classes, allowing for context-specific smell overrides. New detection capabilities include the \DuplicateMethodCall\ smell, which flags repeated identical method calls, and an enhanced \NestedIterators\ detector that now reports the specific nesting depth of violations. The \NilCheck\ detector has been refined to stop reporting warnings for safe navigation operators. Additionally, the tool now supports progress formatters for file inspection, allows exclusion of single files and directories via configuration, and introduces a \--force-exclusion\ flag to ensure excluded paths are respected even when sources are passed on the command line.
reek · high confidence
Refactored AST node architecture and added UTF-8 string handling
The AST layer has been restructured to replace the previous SexpNode with a new Node base class, utilizing an ASTNodeClassMap to dynamically extend nodes with specific behavior modules (SexpExtensions). This refactor includes a new Builder class that overrides string\_value to prevent crashes when parsing Ruby code containing strings with escape sequences incompatible with UTF-8, addressing a known parser issue. Additionally, the SexpExtensions module has been consolidated to manage extensions for various node types like blocks, methods, and lambdas.
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 context classes to support singleton methods and visibility tracking
The context analysis engine has been restructured to properly distinguish between instance and singleton methods, as well as to track method visibility (public, private, protected, module\_function). New context classes have been introduced: \SingletonMethodContext\ and \SingletonAttributeContext\ for singleton definitions, \GhostContext\ to handle metaclasses during tree building, and \VisibilityTracker\ to manage visibility changes. \MethodContext\ and \AttributeContext\ now explicitly track visibility, and \CodeContext\ serves as the base for all context types, including the renamed \RootContext\ (formerly \StopContext\). This allows the tool to correctly analyze and report smells related to singleton methods and visibility modifiers.
lib/reek/context · high confidence
Refactored control parameter detection logic
The internal logic for detecting control parameters has been refactored by introducing a new \ControlParameterFinder\ class. This change restructures how the tool identifies parameters used for control flow (such as in \if\, \case\, \and\, or \or\ statements), likely improving maintainability and clarity of the detection algorithm without altering the external behavior of the smell detector.
_lib/reek/smell\_detectors/control\_parameter\helpers · medium 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
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 67 → 69 (+1.9)
Lenses
- Code Health 75 → 75 (+0.0)
- Architecture 88 → 86 (-1.7)
- Maturity 60 → 64 (+4.2)
- Readiness 68 → 68 (+0.1)
- Security 82 → 82 (+0.0)
- Performance 80 → 80 (+0.0)
Resolved (5)
- Inconsistent naming for AST traversal/filtering operations. Node.each_node uses ignoring for the exclusion list, while CodeContext.local_nodes uses ignored. Additionally, each_node is an iterator yielding to a block, whereas local_nodes likely returns a collection (implied by the plural name and lack of block argument in signature), but the parameter naming inconsistency (ignoring vs ignored) suggests a lack of standardization in the API vocabulary for exclusion filters.
- Inconsistent naming for predicate checks on node types. Node.contains_nested_node? checks for the presence of a specific type, while CodeContext.matches? checks if the context matches a set of candidates. While the domains differ (AST Node vs Context), the semantic intent of 'checking if this entity is/is of type X' is split between contains_nested_node? and matches?. Furthermore, Node has each_node for traversal, but no direct has_node? predicate, forcing users to use contains_nested_node? which is less intuitive than a standard has_type? or matches_type?.
- Off-boarding risk: anonymized user #1
- Outdated: cucumber
- Workflow token permissions not restricted
New (7)
- Off-boarding risk: anonymized user #1
- Orphaned file (lib/reek/configuration/configuration_converter.rb)
- Orphaned file (lib/reek/configuration/configuration_file_finder.rb)
- Orphaned file (lib/reek/configuration/directory_directives.rb)
- Orphaned file (lib/reek/smell_detectors/control_parameter_helpers/call_in_condition_finder.rb)
- Orphaned file (lib/reek/smell_detectors/control_parameter_helpers/control_parameter_finder.rb)
- Workflow token permissions not restricted (.github/workflows/ruby.yml)
Changes since last survey
- 3 commits — 3 feature/other, 0 fixes
By area
- (repo) — 1 commit
- (root) — 1 commit
- features/configuration_files — 1 commit
Notable commits
- change: Merge pull request #1847 from troessner/upgrade-aruba
- change: Update Aruba to version 3.0
- change: Update scenario and steps for tighter output check
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
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 26 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit e8511a3831bfc5fa86750166f20a58694e21319f — the exact code this score is about.
- Scored under rubric-2026.10.5 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer measure-2026.10.34+preprod-c12eef3a1477.