floere/phony
64.9
Adequate · 6 November 2026
12k
lines of production code
Ruby
primary language
4
measurements over time
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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 62 → 65 (+3.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 62 → 62 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 51 → 58 (+6.5)
- Readiness 66 → 66 (+0.0)
- Security 97 → 95 (-1.8)
Resolved (4)
- Ambiguous method signature for config. It is listed as both a Property and a Method with no arguments. In Ruby, this is often redundant or confusing (is it a getter method or an attribute reader?). If it's a getter, it should be consistently defined as a method or property, not both, to avoid reflection inconsistencies.
- Duplication of clean and clean! methods between Phony.Country and Phony.CountryCodes. CountryCodes appears to be a registry/collection that delegates to Country instances. Exposing clean and clean! on both the collection (CountryCodes) and the individual entity (Country) creates redundant API surface. Users might call Phony.CountryCodes.clean vs Phony.Country.with(cc).clean without clear distinction of intent.
- Inconsistent bang (!) method semantics across the main Phony module. While normalize! and format! likely raise errors on failure (standard Ruby convention), split! takes an extra error_number argument, suggesting it might return an error object or handle errors differently than a simple raise. This breaks the uniform expectation that *! methods are simply the 'raise on error' variants of their non-bang counterparts.
- Off-boarding risk: anonymized user #1
New (1)
- Off-boarding risk: anonymized user #1
Written by cca.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 6 November 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.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.