Skip to content
CAI
Software that uses CAICheck a score

whitesmith/rubycritic

61.9

Adequate · 28 September 2026

2.7k

lines of production code

Ruby

with JavaScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

RubyCritic is a command-line tool that analyzes Ruby codebases to assess and report on code quality. It aggregates metrics from static analysis tools like Reek, Flog, and Flay, alongside test coverage data and version control churn, to generate detailed reports in HTML, JSON, or console formats. The system supports continuous integration workflows by enabling branch comparisons and enforcing minimum quality thresholds to prevent regressions.

How it got here

2013–2014 — Major internal refactor and CI integration

26 changes.

RubyCritic underwent a significant internal restructuring to support Ruby 4.0, introducing a modular architecture with dedicated classes for analysis, source control, and configuration. The project standardized its development tooling and expanded its capabilities with a new CI command for branch comparison and minimum score enforcement. Comprehensive test coverage was established for all core components, including refactored analyzers and multi-VCS churn calculations.

2015–2019 — HTML report overhaul and multi-format support

11 changes.

RubyCritic underwent a significant redesign of its HTML report generator, introducing a modern UI with interactive charts, branch comparison capabilities, and a new layout structure. This period also expanded output flexibility by adding support for JSON, console, lint, and text report formats, alongside a revamped CLI argument parser to manage these new options and CI integration modes.

2020–2026 — Testing expansion and CI modernization

5 changes.

This period focused on expanding test coverage by adding comprehensive unit tests for Git churn analysis and integration tests for the CLI and Rake tasks. The project also modernized its continuous integration infrastructure to support Ruby 3.0, dropped support for Ruby 2.4, and configured Appraisal to ensure compatibility with various SimpleCov versions.

Features

Add JSON report generation capability

Users can now generate code analysis reports in JSON format. A new \RubyCritic::Generator::Json::Simple\ class has been introduced to handle this, which collects metadata (including the RubyCritic version), the list of analyzed modules, and the overall score, then outputs the result to a file named \report.json\ in the project root directory.

lib/rubycritic/generators/json · high confidence

Add RubyCritic executable entry point

A new executable script at bin/rubycritic has been added to the project. This script configures the Ruby load path to prioritize the gem's local lib directory and initializes the RubyCritic::Cli::Application to handle command-line arguments, enabling users to run the tool directly from the command line.

bin · high confidence

Add text-based lint and list report generators

Users can now generate plain-text reports for linting issues and code quality summaries. The new \Lint\ generator outputs a simple list of code smells with their locations, while the \List\ generator provides a detailed breakdown including ratings, churn, complexity, duplication, and smell counts, with ratings colorized using the \rainbow\ library.

lib/rubycritic/generators/text · high confidence

Initial implementation of the HTML report JavaScript assets

This change introduces the core JavaScript file (application.js) that powers the interactive HTML reports. It enables sidebar navigation highlighting based on the current page URL, renders the 'Churn vs Complexity' scatter plot and the GPA distribution pie chart using Highcharts, and implements code navigation features such as highlighting specific code lines when clicking smell locations or using anchor links.

lib/rubycritic/generators/html/assets/javascripts · high confidence

Initial release of the RubyCritic HTML report stylesheet

This change introduces the primary CSS file (application.css) for the RubyCritic HTML report generator. It establishes the visual foundation for the web UI, including the layout for the collapsible sidebar, the styling for summary cards and rating indicators (color-coded for green, yellow, orange, red, and maroon), and the typography using Roboto fonts. This stylesheet is required to render the generated HTML reports with the intended design.

lib/rubycritic/generators/html/assets/stylesheets · high confidence

Introduce modular source control system architecture with Git, Mercurial, and Perforce support

RubyCritic now uses a pluggable source control system architecture that automatically detects and utilizes Git, Mercurial, or Perforce repositories to calculate churn metrics and revision counts. If no supported version control system is found, the tool gracefully degrades by displaying a helpful message and skipping churn calculation, ensuring it can still run outside of a project or in unsupported environments.

_lib/rubycritic/source\_control\systems · high confidence

New CI command with branch comparison and minimum score enforcement

RubyCritic now includes a \mode-ci\ command (via \RubyCritic::Command::Ci\) designed for continuous integration environments. This command compares code quality between a base and a feature branch, analyzing only modified files to generate a diff report. It enforces a configurable minimum score threshold; if the feature branch's score falls below this minimum or the difference between branches exceeds a set limit, the command aborts with a non-zero exit status, allowing CI pipelines to fail automatically on quality regressions.

lib/rubycritic/commands · high confidence

New HTML layout template for Ruby Critic reports

The HTML report generator now uses a new application layout template that structures the report with a fixed top navigation bar, a collapsible sidebar for navigation (Overview, Code, Smells, Coverage), and a main content area. The layout includes standard HTML5 meta tags, links to Bootstrap, Font Awesome, and custom stylesheets, and loads necessary JavaScript libraries including jQuery, tablesorter, Highcharts, and prettify. It also supports a comparison mode UI when comparing branches.

lib/rubycritic/generators/html/templates/layouts · high confidence

New report generation formats: Console, JSON, and Lint

RubyCritic now supports generating reports in three additional formats alongside the existing HTML output. Users can produce a Console report for terminal-based analysis, a JSON report for programmatic consumption or integration with other tools, and a Lint report for simplified code quality feedback. These new generators are implemented in lib/rubycritic/generators/console\_report.rb, json\_report.rb, and lint\_report.rb respectively, expanding the ways users can consume critique results.

lib/rubycritic/generators · high confidence

Standardize project configuration and development tooling

This change introduces a suite of configuration files to standardize the development environment and code quality checks. It adds \.editorconfig\ for consistent coding styles (UTF-8, 2-space indentation, LF line endings), \.rubocop.yml\ to enforce Ruby style rules with specific plugins and exclusions, \.reek.yml\ to configure code smell detection, and \.mdlrc\ to define Markdown linting rules. Additionally, it includes \.solargraph.yml\ for editor LSP integration, \.yardopts\ for documentation generation, and an \Appraisals\ file to test compatibility across different versions of the SimpleCov gem. The \Rakefile\ is also updated to integrate these tools into the default build tasks.

(repo-wide) · high confidence

Behavioural changes

Introduces structured CLI entry point with error handling

The RubyCritic command-line interface now uses a dedicated \RubyCritic::Cli::Application\ class to manage execution. This change delegates the creation of the analysis command to a \CommandFactory\, allowing for more flexible command instantiation based on parsed options. Additionally, the CLI now gracefully handles invalid command-line arguments by catching \OptionParser::InvalidOption\ errors, displaying a user-friendly warning message instead of crashing with a stack trace.

lib/rubycritic/cli · high confidence

New CLI argument parser with support for custom formatters and CI mode

RubyCritic now uses a dedicated \Argv\ class to parse command-line options, introducing several new capabilities for users. Users can now specify multiple output formats (HTML, JSON, console, lint) via the \-f\ flag and load custom formatter classes using \--custom-format\. A new \--churn-after\ option allows filtering git churn analysis by date, and \--mode-ci\ enables a faster CI mode that compares against a base branch (defaulting to 'main'). Additional flags include \--coverage-path\ to specify the SimpleCov coverage directory, \--deduplicate-symlinks\ to handle symlink targets, and \--suppress-ratings\ to hide letter grades in reports.

lib/rubycritic/cli/options · high confidence

New HTML report generator with branch comparison support

The HTML report generator has been rewritten to produce a new set of pages (overview, code index, smells index, and simple coverage index) and to support comparing code between branches. When the compare mode is enabled, the generated reports include navigation links to the base, feature, and build versions of files and indices, and the code file view highlights smells per line. The turbulence data for the overview is now exported as JSON, and view helpers manage relative paths and fallbacks to overview.html when specific index pages are missing.

lib/rubycritic/generators/html · high confidence

New analysis summary, CLI configuration, and multi-VCS churn support

RubyCritic now includes an AnalysisSummary class to aggregate file counts, churn, and smells by rating grade, and a Browser class to optionally open HTML reports via Launchy. CLI options can now be merged from a YAML config file (defaulting to .rubycritic.yml) with command-line arguments taking precedence, supporting settings like formats, minimum score, and paths. The Churn metric has been refactored to support Git with path scoping and a churn\_after filter, and Perforce source control is now supported for churn calculations.

rubycritic · high confidence

Refactor core analysis model to use AnalysedModule and introduce per-file ratings

The core analysis logic has been restructured to replace the previous file-based model with a new \AnalysedModule\ class, which encapsulates metrics such as complexity, duplication, churn, and coverage for individual code units. This change introduces a new grading system where modules receive letter ratings (A–F) based on their calculated cost, visible in the code index. Additionally, smell objects now include links to documentation for their respective analyzers (Reek, Flay, Flog), improving the user's ability to understand and resolve reported issues.

lib/rubycritic/core · high confidence

Refactored analyser helpers to use a unified parser and explicit wrapper classes

The helper modules for code analysis (Flay, Flog, Reek) have been refactored to use explicit wrapper classes that encapsulate configuration and initialization logic, replacing previous inline or implicit setups. A new Parser module has been introduced to standardize AST parsing, automatically selecting the appropriate parser engine based on the Ruby version (using \parser/current\ for Ruby 3.3 and below, and \prism\ for Ruby 3.4 and above). This change ensures consistent parsing behavior and simplifies the integration of static analysis tools by centralizing parser selection and providing a clean interface for node traversal and module name extraction.

lib/rubycritic/analysers/helpers · high confidence

Refactored analyzers into dedicated classes with configurable coverage paths

The analyzer logic in lib/rubycritic/analysers has been restructured into distinct classes (Attributes, Churn, Complexity, Coverage) that all implement a unified \run\ interface. This change introduces a configurable coverage path, allowing users to specify a custom location for SimpleCov result files via \Config.coverage\_path\ instead of relying solely on the default directory. Additionally, the Coverage analyzer now supports SimpleCov versions 0.19 and above, ensuring compatibility with newer test coverage data formats.

lib/rubycritic/analysers · high confidence

Refactored smell analyzers to use analyzed\_modules and respect Reek exclusions

The smell analyzers (Flay, Flog, and Reek) have been refactored to accept and process \analysed\_modules\ instead of raw paths, enabling more precise integration with the core analysis pipeline. Specifically, the Reek analyzer now explicitly filters out files based on the \Reek.configuration.path\_excluded?\ check during initialization, ensuring that excluded paths are not analyzed. The Flay and Flog analyzers have been updated to iterate over these modules, with Flog applying complexity thresholds to categorize smells as High or Very High.

lib/rubycritic/analysers/smells · high confidence

Rename module to RubyCritic and initialize CommandFactory

The library's main module has been renamed from Rubycritic to RubyCritic, and the boilerplate code has been replaced with a require for the new CommandFactory class. This change reflects the internal refactoring of the public API and the shift towards a command-based architecture.

lib · high confidence

Revamped HTML report UI with new pages and layout

The HTML report generator has been completely redesigned with new templates for the Overview, Code, Smells, and Coverage pages. The Overview now features a GPA chart and a Churn-vs-Complexity graph, while the Code page displays a sortable table of metrics including ratings, churn, complexity, duplication, and smells. A new Coverage page has been added to display SimpleCov integration results, and the Smells page now includes a status column. The Code file view has been updated to show detailed statistics and code tabs, and smell descriptions are now rendered with icons and location links.

lib/rubycritic/generators/html/templates · high confidence

RubyCritic v5.0: Major internal refactor and Ruby 4.0 support

RubyCritic has been updated to version 5.0.0, dropping support for Ruby 2.7 and adding support for Ruby 4.0. The release introduces a significant internal refactor to improve code organization and maintainability, including the introduction of new classes such as \AnalysersRunner\, \CommandFactory\, \Configuration\, \SourceLocator\, \RevisionComparator\, and \Serializer\. The public API has been refactored, and the gem name has been standardized to \RubyCritic\ (capitalized). These changes provide a more robust foundation for future features and better handling of analysis tasks, configuration, and source file location.

lib/rubycritic · high confidence

Updated CI scripts to support Ruby 3.0 and drop Ruby 2.4

The Travis CI configuration scripts have been updated to support testing against Ruby 3.0 while removing support for Ruby 2.4.x. The new \before\_script.sh\ conditionally runs \appraisal install\ only for non-3.0 versions, and \script.sh\ routes test execution to \bundle exec rake test\ for Ruby 3.0 or \bundle exec appraisal rake test\ for other versions, ensuring compatibility with the updated dependency requirements.

_travis\scripts · high confidence

Updated vendor font assets for HTML reports

The HTML report generator now includes updated SVG font files for FontAwesome and Glyphicons Halflings in the vendor assets directory. These changes ensure that icons and symbols render correctly in the generated code quality reports.

lib/rubycritic/generators/html/assets/vendor · high confidence

Test coverage

Added Reek static analysis test fixtures; Added integration tests for RubyCritic CLI and Rake task; Added test coverage for report generators and view helpers; Added test fixtures for Flay adapter; Added test fixtures for Ruby source file detection; Added test fixtures for code analysis and reporting; Added test fixtures for complex and smelly Ruby code; Added tests for Churn, Complexity, and Coverage analysers; Added tests for Flay, Flog, and Reek smell analyzers; Added tests for Git churn analysis; Added tests for MethodsCounter and ModulesLocator helpers; Added tests for branch comparison and status reporter score formatting; Added tests for source control system integrations; Added tests for source control system interfaces; Added unit tests for RubyCritic core components; Added unit tests for RubyCritic core domain models; Establishes foundational test infrastructure and helpers.

Dependencies

Add Appraisal configurations for SimpleCov 0.17, 0.18, and 0.19

The project now includes dedicated Gemfiles and lockfiles for SimpleCov versions 0.17, 0.18, and 0.19, generated via Appraisal. This allows the test suite to run against these specific versions of the SimpleCov library, ensuring compatibility and detecting any behavioral changes in code coverage reporting across these releases.

gemfiles · high confidence

RubyCritic now requires Ruby 3.2+ and updates core analysis dependencies

RubyCritic has raised its minimum supported Ruby version to 3.2.0 and updated its static analysis dependencies to modern versions, including Reek (\~\> 6.5.0), Flog (\~\> 4.7), Flay (\~\> 2.13), and Parser (\>= 3.3.0.5). The gem now explicitly depends on the \prism\ parser for Ruby 3.4+ compatibility and includes \rexml\ as a runtime dependency. Development dependencies have also been refreshed, with RuboCop updated to \>= 1.72.0 and test tools like Minitest (\~\> 6.0.0) and Mocha (\~\> 3.1.0) bumped to current releases.

(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 71 → 62 (-9.3)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 100 → 73 (-26.6)
  • Maturity 61 → 61 (+0.0)
  • Readiness 65 → 65 (+0.2)
  • Security 92 → 94 (+2.0)
  • Accessibility 55 (new)

New (5)

  • Duplicate intent between Config and Configuration. Config appears to be a facade or singleton wrapper around Configuration, exposing methods like configuration() and set(). Configuration itself has set() and setup_* methods. This creates two entry points for configuration management, leading to potential confusion about which class to use for configuration operations.
  • Inconsistent initialization vs execution pattern for analyzers. Most analyzers (Attributes, Churn, Complexity, Coverage, FlaySmells, FlogSmells, ReekSmells) follow a pattern of initialize(data) followed by run(). However, RubyCritic.AnalysersRunner also has a run() method, but it is a coordinator, not a single analyzer. More critically, RubyCritic.Analyser.Churn has a property source_control_system which is not present on other analyzers, breaking the uniform interface expectation for the Analyser family.
  • Inconsistent naming for report generation. While most generators use generate_report(), the HTML sub-generators (e.g., Html.CodeFile, Html.Overview) and Text sub-generators use render(). This creates confusion about whether generate_report is the high-level entry point and render is the low-level output step, or if they are interchangeable. Specifically, HtmlReport uses generate_report while its children use render, but ConsoleReport uses generate_report directly without a clear render equivalent in the same hierarchy.
  • Inconsistent return types or semantics for collection queries. find typically implies returning a single item or raising an error if not found, while where implies returning a collection. However, where takes module_paths (plural) and find takes module_path (singular). This is a minor inconsistency in naming convention (singular vs plural argument names) which can be confusing for API consumers expecting consistent pluralization for collection methods.
  • Projects may be oversized for their cohesion

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

whitesmith/rubycritic 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 a70e68cdee9b99e1f8567430850ffff1bbad273e — 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.