josefs/Gradualizer
65.8
Adequate · 23 September 2026
10.2k
lines of production code
Erlang
primary language
5
measurements over time
What this system is
Gradualizer is a static type-checking tool for Erlang that performs constraint-based type inference and exhaustiveness analysis. It provides a command-line interface and library API to validate Erlang code against user-defined and standard library type specifications. The system supports advanced features such as polymorphic call inference, type refinement, and intersection types, while also tracking known limitations through a comprehensive suite of passing and failing test cases.
How it got here
2017–2018 — Initial project scaffolding and type inference
12 changes.
This period established the project's foundational infrastructure, including CI workflows, documentation, and the core constraint-based type inference engine. It simultaneously built out a comprehensive test suite to validate type checking, pattern matching, and error handling across various Erlang constructs.
2019–2023 — Type system expansion and test coverage
6 changes.
This period focused on expanding the Gradualizer's type system by introducing new annotation and assertion macros, alongside refining type specifications for OTP core and standard library modules. The work was supported by comprehensive test coverage, including property-based tests and helper modules, to ensure the correctness of type checking and error reporting.
Features
Add rebar3 Gradualizer example with app filtering
Added a new example for the rebar3 Gradualizer plugin, including a README and rebar.config. The example demonstrates how to configure the plugin to filter type checking to specific applications using the new \apps\ option, which accepts a comma-separated list of apps to analyze. The example also shows how to exclude specific files from type checking.
examples · high confidence
Add rebar3 example project files
The rebar3 example directory now includes the necessary source files to define a minimal Erlang application, including the application resource file (rebar3\_example.app.src) and two Erlang modules (rebar3\_example.erl and not\_included.erl) that serve as a template for users creating their own rebar3-based projects.
examples/rebar3 · medium confidence
Added documentation for the Gradualizer type system and examples
New documentation files have been added to the doc directory, including a Haskell implementation of the gradually typed lambda calculus (GTLC.hs), a markdown file detailing the Gradualizer's type system and subtyping rules (typesystem.md), and an examples file (examples.md) that demonstrates the Gradualizer in action with Erlang code snippets and screenshots. These files provide background on the type system and show how the tool handles exhaustiveness checking and diagnostics.
doc · high confidence
Initial project scaffolding and tooling configuration
The repository was initialized with essential configuration files to support development and CI workflows. This includes a Makefile for building the Gradualizer CLI and running tests, a Travis CI configuration (.travis.yml) to automate testing across multiple OTP versions, and a .codecov.yml to configure code coverage reporting. Additionally, an .editorconfig file was added to enforce consistent coding styles across editors, and a .gitignore file was created to exclude build artifacts and temporary files from version control.
(repo-wide) · high confidence
Introduce constraint-based type inference for polymorphic calls
The type checker now supports inferring types for polymorphic function calls using a constraint solver. This is enabled by the new \--solve\_constraints\ CLI flag and the \solve\_constraints\ option in the library API. The implementation introduces a \constraints\ module to track lower and upper bounds for type variables, which are then solved to determine the most specific types. This allows Gradualizer to infer return types and argument types for functions without explicit specs, provided the constraints are satisfiable.
src · high confidence
New type annotation and assertion macros
A new header file, gradualizer.hrl, introduces macros for type annotation and refinement. The ?annotate\_type macro allows annotating expressions with a specific type, while ?assert\_type enables refining or downcasting types. These are implemented via the '::'/2 and ':::'/2 functions, which Gradualizer recognizes for type checking adjustments.
include · high confidence
Behavioural changes
Added type specifications for Erlang standard library modules
Added new specification files for the \epp\, \erl\_anno\, and \timer\ modules to the Gradualizer spec database. These files provide type definitions that allow Gradualizer to resolve types that are either removed in newer OTP versions (like \epp:open/5\) or defined as -nominal in OTP 28 (like \erl\_anno\ and \timer\ types), ensuring compatibility and correct type checking for these standard library components.
_priv/extra\specs · medium confidence
Automated coverage reporting and OTP version validation in CI
The CI pipeline now automatically uploads code coverage reports to Codecov when the \ENABLE\_COVER\ environment variable is set, and includes a script to validate that the build is using the latest available Erlang/OTP version, failing the build if a newer version is available.
.travis · high confidence
Improved type specifications for OTP core modules
The Gradualizer prelude now provides more precise type specifications for functions in the erlang, filename, and lists modules. These overrides correct inexact or missing specs in the standard library, such as allowing erlang:error/2 and /3 to accept 'none' for the Args parameter, refining the return types for min/max, and providing polymorphic specs for list operations like flatten, fold, and mapfold. This results in more accurate static analysis and better type inference for users relying on Gradualizer.
priv/prelude · medium confidence
Test coverage
Add known problems test suite; Add property-based tests for the Gradualizer typechecker; Added comprehensive test suite for Gradualizer components; Added test cases for known type-checking issues; Added test coverage for compile-time and lint errors; Added test for the fail function; Added test helpers for undefined and unexported type errors; Expanded test coverage for type checking and pattern matching; Expanded test coverage for type checking failures.
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
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 66 → 66 (+0.1)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 94 → 82 (-12.2)
- Architecture 100 → 100 (+0.0)
- Maturity 54 → 54 (+0.1)
- Readiness 64 → 78 (+13.7)
- Security 75 → 67 (-8.3)
- Event Sourcing 100 → 100 (+0.0)
Resolved (10)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No exposed public API
- Test reliability not included
- TooManyMethods: typechecker (src/typechecker.erl)
- complexity unreadable for .erl, .hrl — churn × complexity hotspots could not be measured
New (148)
- Coverage not measured — no coverage collector is wired up
- Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (src/typechecker.erl)
- Duplicated block (11 lines × 2) (src/typechecker.erl)
- Duplicated block (15 lines × 2) (src/typechecker.erl)
- Duplicated block (17–18 lines × 2) (src/typechecker.erl)
- Duplicated block (4–5 lines × 4) (src/typechecker.erl)
- Duplicated block (5 lines × 2) (src/typechecker.erl)
- Duplicated block (5 lines × 2) (src/typechecker.erl)
- Duplicated block (5 lines × 2) (src/typechecker.erl)
- Duplicated block (5 lines × 2) (src/typechecker.erl)
- Duplicated block (6 lines × 2) (src/typechecker.erl)
- Duplicated block (6 lines × 2) (src/typechecker.erl)
- Duplicated block (6 lines × 3) (src/typechecker.erl)
- Duplicated block (8 lines × 2) (src/typechecker.erl)
- Duplicated block (8–9 lines × 2) (src/typechecker.erl)
- FixmeComment (src/gradualizer_bin.erl)
- High: security finding (details withheld)
- …and 128 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
josefs/Gradualizer 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 23 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 23533d7eb7541d8a146a507e837fdfff6499a202 — 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-955b9cee9818.