Skip to content
CAI
Software that uses CAICheck a score

floere/phony

68.8

Adequate · 20 September 2026

12k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the Phony Ruby gem, a library designed to normalize, split, and format international phone numbers. It provides configurable country-specific parsing rules, supporting both fixed and regex-based splitting strategies for area codes and local numbers. The system includes tools for performance profiling, code style enforcement, and comprehensive test coverage to ensure accurate validation across a wide range of international numbering plans.

How it got here

2008–2010 — Phony library core development

12 changes.

This period focused on establishing the Phony phone number library, introducing core features for normalizing, splitting, and formatting international numbers with extensive country-specific definitions. The work included refactoring the national splitting logic into a flexible DSL-based system and implementing configurable country loading to optimize memory usage. Additionally, the project set up a robust testing infrastructure and code quality tooling to support the new functionality.

2011–2019 — regex splitters and performance profiling

7 changes.

This period focused on enhancing number validation flexibility by introducing regex-based local splitters and expanding test coverage for configuration and plausibility checks. It also established infrastructure for performance optimization through dedicated profiling scripts and QED helpers, alongside tooling improvements for release workflows.

Features

Added performance profiling scripts for Phony

New scripts have been added to the performance directory to help developers analyze and optimize the library's execution speed. The \perfer.rb\ script uses the Perfer gem to benchmark \Phony.normalize\ with increasing call volumes, while \rubinius.rb\ and \stackprof.rb\ provide profiling capabilities for the Rubinius and standard Ruby runtimes respectively, allowing users to identify bottlenecks in \Phony.normalize\, \Phony.format\, and \Phony.plausible?\ methods.

performance · high confidence

Added release and tag shell scripts

New executable scripts have been added to the bin directory to streamline versioning workflows. The bin/release script now executes 'gem release', and bin/tag executes 'gem tag -p', allowing users to trigger these specific gem operations directly from the command line.

bin · high confidence

Expanded country phone number definitions

The library now includes comprehensive phone number parsing and formatting rules for a large number of countries, including Argentina, Austria, Bangladesh, Belarus, Brazil, Cambodia, China, Croatia, Georgia, Germany, Guinea, India, Indonesia, Ireland, Italy, Japan, Kyrgyzstan, Latvia, Libya, Malaysia, Moldova, Montenegro, Myanmar, Namibia, Nepal, Netherlands, Pakistan, Paraguay, Russia (including Abkhazia and South Ossetia), Serbia, Somalia, South Korea, Sweden, Taiwan, Tajikistan, Turkmenistan, Ukraine, Uruguay, Vietnam, and Zimbabwe. This update significantly broadens international coverage and improves the accuracy of number validation and splitting for these regions.

lib/phony/countries · high confidence

Introduce configurable country code loading to reduce memory footprint

Phony now supports selective loading of country definitions via a new \Phony::Config\ system. Users can configure the library to load only specific country codes (using \only:\) or exclude specific ones (using \except:\) before initialization. This allows applications to significantly reduce memory usage and startup time by avoiding the loading of unused country rules, which is particularly useful for services that only handle a subset of international numbers.

lib/phony · high confidence

Introduce regex-based local number splitting

Added a new Regex local splitter that allows countries to define custom splitting rules using regular expressions and format mappings, providing an alternative to the existing fixed-format splitting logic for more flexible number validation and segmentation.

_lib/phony/local\splitters · high confidence

Introduction of Phony phone number library

The library introduces a new capability to normalize, split, and format international phone numbers. It provides a main \Phony\ module with methods like \normalize\, \split\, and \format\ to handle E164 numbers, including support for vanity numbers and specific country definitions (e.g., Argentina, Brazil, Germany, US/NANP). The implementation includes custom error classes (\NormalizationError\, \SplittingError\, \FormattingError\) and relies on a DSL-based configuration for national splitters and country codes.

lib · high confidence

New QED applique helpers for phone number validation and performance benchmarking

The qed/applique directory now includes helper modules to support quality engineering tests. The phony.rb file adds a plausible? method that validates phone numbers against provided true/false examples using the Phony library, and a performance\_of method that benchmarks code execution while accounting for a configurable performance ratio. The ae.rb file provides a placeholder for additional helper methods.

qed/applique · high confidence

Removals

Removed legacy NDC splitting logic for Austria and base classes

The library has removed the old National Dialing Code (NDC) splitting implementation, specifically deleting the \E164::NDC::Austria\ class which contained hardcoded prefix rules for Austrian phone numbers, as well as the foundational \E164::NDC::FixedSize\ and \E164::NDC::Prefix\ base classes. This change eliminates the previous mechanism for splitting national numbers into fixed-size or prefix-based NDC segments, indicating a shift toward a different parsing strategy for these regions.

lib/ndc · high confidence

Behavioural changes

Added empty Bundler configuration file

A new .bundle/config file has been added to the project, initialized with an empty configuration object. This ensures that the Bundler configuration directory structure exists, likely to prevent default behavior overrides or to prepare for future specific bundler settings, without altering any existing dependency resolution or runtime behavior.

.bundle · medium confidence

Added issue snippet for normalizing New Zealand phone numbers

A new Ruby script (misc/issue-snippets/270.rb) was added to demonstrate the normalization of various New Zealand phone number formats using the Phony library. The snippet illustrates how to handle inputs with leading zeros, plus signs, and country codes by stripping them and standardizing the output.

misc · high confidence

Project configuration and documentation updates

This change introduces several new configuration files and documentation updates to the project. A new \.rubocop.yml\ file is added to enforce code style using Rubocop with specific extensions (rubocop-performance, rubocop-rspec, rubocop-rake) and custom rules, including a line length limit of 180 and Ruby 3.2 target. An \.rspec\ file is added to configure RSpec with color, progress format, and random ordering. An \.inch.yml\ file is added to configure code documentation analysis for specific library files. The \Rakefile\ is updated to run both RSpec and QED tests by default. Documentation files including \README.md\, \CONTRIBUTING.md\, \HISTORY.md\, and \RELEASING.md\ are added or updated. The \LICENSE\ file is updated with a new copyright year. The \.gitignore\ file is expanded to ignore more files like bundler config, SQLite databases, logs, temp files, and coverage reports.

(repo-wide) · high confidence

Refactored national number splitting logic with new splitter classes

The national number splitting mechanism has been rewritten to use a new set of specialized classes (Default, Fixed, None, Regex, Variable) that inherit from a common DSL base. This change alters how national parts of phone numbers are parsed into area codes (NDC) and local numbers, introducing more flexible splitting strategies such as regex-based matching and variable-length NDC handling. Users will see changes in how numbers are split and validated, particularly for countries with complex or variable-length area codes, and the system now caches splitter instances for performance.

_lib/phony/national\splitters · high confidence

Test coverage

Added comprehensive test suite for Phony's country splitting and formatting logic; Added functional tests for Phony configuration and plausibility validation; Added test coverage for national splitter implementations; Added tests for Fixed and Regex local splitters; Initial test suite setup with spec helpers and coverage configuration; Tests added for normalization, splitting, and formatting error handling.

Dependencies

Phony gem 3.0.6 release with Ruby 3.2 requirement and Rubocop tooling

The Phony gem has been updated to version 3.0.6, which now requires Ruby 3.2 or higher. The project has introduced a Gemfile and Gemfile.lock to manage dependencies, adding Rubocop (with performance, rake, and rspec extensions) for code style enforcement and SimpleCov for test coverage reporting. The gemspec has been cleaned up, removing the author field and adding metadata for multi-factor authentication requirements on RubyGems.

(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

Baseline

  • First survey — no prior run to compare against. CAI 69.

Lenses

  • Code Health 97
  • Architecture 100
  • Maturity 55
  • Readiness 64
  • Security 96

Changes since last survey

  • 300 commits — 280 feature/other, 20 fixes

By area

  • lib/phony — 121 commits
  • (root) — 79 commits
  • (repo) — 50 commits
  • spec/lib — 27 commits
  • qed/plausibility.md — 6 commits
  • .github/workflows — 5 commits
  • spec/functional — 4 commits
  • spec/spec_helper.rb — 3 commits
  • performance/rubinius.rb — 1 commit
  • performance/stackprof.rb — 1 commit
  • qed/applique — 1 commit
  • qed/country-specific.md — 1 commit
  • qed/split.md — 1 commit

Notable commits

  • fix: Fix #522: don't strip trunk '8' from Tajikistan MegaFon 88x mobile numbers when normalizing
  • fix: Fix Luxembourg phone matchers
  • fix: Fix Pakistani UAN handling
  • fix: Fix Rubocop
  • fix: Fix Rubocop offenses
  • fix: Fix Samoa order in plausability document
  • fix: Fix bhutanese validations
  • fix: Fix for Colombian phone numbers
  • fix: Fix for Rome (Italy) numbers
  • fix: Fix frozen string litteral warnings in Ruby 3.4
  • fix: Fix trunk prefix for Laos
  • fix: Fix warning requiring benchmark from standard lib
  • fix: Merge pull request #498 from haberbyte/fix-rome-numbers
  • fix: Merge pull request #521 from yoshih/fix-luxembourg-phone
  • fix: Merge pull request #528 from jwach-clari/fix-pakistan-uan-numbers
  • fix: Merge pull request #556 from dnsimple/bug-singapore
  • fix: Merge pull request #561 from davemcginnzendesk/nz-fix
  • fix: Merge pull request #570 from youdie006/fix/522-tajikistan-trunk-normalize
  • fix: fix madagascar format
  • fix: fix(527): full support for Pakistani UAN numbers
  • …and 280 more

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

Survey your own repository

floere/phony 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 20 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 7116f3057671aed0b47da1dfd06724a1af84a9d3 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.