Skip to content
CAI
Software that uses CAICheck a score

Comcast/ip4s

58.0

Adequate · 20 September 2026

2.9k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a cross-platform Scala library for handling IP addresses, hostnames, and network interfaces. It provides core types for IPv4/IPv6, CIDR, and ports, along with platform-specific implementations for DNS resolution and network interface discovery on JVM, JavaScript, and Native targets. The library also includes compile-time validated string interpolators and a test kit for property-based testing.

How it got here

2018 — Initial project setup and core networking features

4 changes.

The ip4s library was initialized with its core project structure, build configuration, and documentation. This period established foundational networking capabilities, including a unified Host type, DNS resolution, network interface discovery, and support for Unix domain sockets and multicast. The project also upgraded to Scala 3.3.8 and updated core dependencies to ensure compatibility and stability.

2019 — test-kit expansion and test framework migration

3 changes.

This period focused on enhancing the test-kit module by publishing ScalaCheck arbitraries for IP4S types to facilitate property-based testing. The team also migrated the shared test suite to Munit and ScalaCheck, while adding specific JVM platform tests for IPv6 address handling and compliance.

2020–2025 — Scala 3 migration and platform support

5 changes.

The project expanded its Scala 3 compatibility by introducing compile-time validated literal string interpolators and updating collection interop APIs to replace deprecated Java converters. It also added JVM-specific platform implementations for DNS and network interface handling, alongside test utilities for JavaScript and Native targets.

Features

Add JVM-specific platform implementations for ip4s core types

This change introduces a new \jvm-native\ source directory containing platform-specific implementations for the ip4s library on the JVM. It adds concrete support for DNS resolution (using \java.net.InetAddress\), IP address conversion (via \toInetAddress\/\fromInetAddress\ for IPv4/IPv6), and network interface enumeration (using \java.net.NetworkInterface\). It also provides platform-specific handling for \SocketAddress\ conversion to/from \java.net.InetSocketAddress\ and defines the \UnknownHostException\ type alias, enabling these features to function correctly on the JVM target.

jvm-native · high confidence

Add Scala 2 literal string interpolators for IP and network types

This change introduces compile-time validated literal string interpolators for Scala 2, allowing users to write expressions like \ip"192.168.1.1"\ or \port"8080"\ directly in code. The implementation uses the Typelevel Literally library to provide macros that validate the string content at compile time, returning a compile error if the value is invalid (e.g., an invalid IP address or port). Supported types include IP addresses (IPv4/IPv6), multicast addresses (including source-specific multicast), ports, hostnames, and internationalized domain names (IDN).

shared/src/main/scala-2 · high confidence

Adds Node.js-based DNS and network interface resolution for Scala.js

This change introduces platform-specific implementations for the \js\ target, enabling runtime DNS lookups and network interface discovery in Node.js environments. Users can now resolve hostnames to IP addresses (including reverse lookups) and retrieve local network interface details (such as MAC addresses and CIDR blocks) using the \Dns\ and \NetworkInterfaces\ APIs, which are wired to the native Node.js \dns\ and \os\ modules via Scala.js interop.

js · high confidence

Initial project setup and build configuration

This change introduces the initial commit for the ip4s library, establishing the core project structure and build infrastructure. It adds configuration files for the build tool (sbt) and code formatting (scalafmt 3.11.3), sets up standard documentation (README, CONTRIBUTING, CODE\_OF\_CONDUCT, NOTICE), and configures version control exclusions (gitignore) for IDE and build artifacts.

(repo-wide) · high confidence

Introduce unified Host type and platform-agnostic networking capabilities

The library now provides a unified \Host\ type that serves as a supertype for \IpAddress\, \Hostname\, and \IDN\, allowing users to handle different host representations uniformly. This change introduces a new cross-platform \Dns\ capability for resolving hostnames and performing reverse lookups, along with a \NetworkInterfaces\ capability to query local network interfaces. Additionally, the library adds support for Unix domain sockets via \UnixSocketAddress\, expands multicast support with \MulticastJoin\ and \MulticastSocketAddress\, and introduces new types for \MacAddress\ and \Cidr\ utilities like \addresses\ and \totalIps\.

shared/src/main/scala · high confidence

Publish ScalaCheck Arbitraries as a separate test-kit artifact

The test-kit module now exposes a dedicated \Arbitraries\ object containing ScalaCheck generators and implicit \Arbitrary\ instances for IP4S types, including IPv4/IPv6 addresses, CIDR blocks, ports, socket addresses, multicast groups, hostnames, IDNs, and MAC addresses. This allows users to easily generate random test data for these types in their own property-based tests without needing to implement their own generators.

test-kit/shared/src/main · high confidence

Behavioural changes

9 commits (1 fix) modifying shared/src/main/scala-3

A change to existing behaviour in shared/src/main/scala-3 — 9 commits (1 fix), 2 files.

shared/src/main/scala-3 · medium confidence · unverified

Updated Scala 2.13 and 3 collection compatibility to use modern Java interop APIs

The library has updated its internal collection compatibility layer to use \scala.jdk.CollectionConverters\ for Scala 2.13 and Scala 3, replacing the deprecated \scala.collection.JavaConverters\ used in Scala 2.12. This change ensures that conversions between Java collections (such as \Iterable\, \List\, and \Enumeration\) and Scala collections remain compatible with current Scala standards and avoids deprecation warnings in newer Scala versions.

shared/src/main/scala-2.12, shared/src/main/scala-2.13, shared/src/main/scala-3/com · high confidence

Test coverage

Added JVM-specific tests for Ipv6Address and test platform utilities; Added platform-specific test utilities for JavaScript and Native targets; Port test suite to Munit and ScalaCheck.

Dependencies

Upgrade to Scala 3.3.8 and update core dependencies

The project now targets Scala 3.3.8 (alongside 2.12.21 and 2.13.18) and updates its core dependencies, including cats-effect to 3.7.0, cats-core to 2.13.0, and idna4s-core to 1.0.0. The test kit also updates scalacheck to 1.19.0 and munit-cats-effect to 2.2.0. Binary compatibility filters have been adjusted to account for changes in Scala 3 and the removal of JS-specific Punycode bindings.

(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 58.

Lenses

  • Code Health 95
  • Architecture 100
  • Maturity 49
  • Readiness 50
  • Security 70

Changes since last survey

  • 300 commits — 293 feature/other, 7 fixes

By area

  • (repo) — 140 commits
  • (root) — 66 commits
  • project/plugins.sbt — 42 commits
  • shared/src — 19 commits
  • project/build.properties — 16 commits
  • .github/workflows — 7 commits
  • test-kit/shared — 4 commits
  • js/src — 3 commits
  • jvm-native/src — 1 commit
  • jvm/src — 1 commit
  • native/src — 1 commit

Notable commits

  • fix: Fix JS
  • fix: Fix compilation
  • fix: Fix native
  • fix: Fix test
  • fix: Fixes #662
  • fix: Merge pull request #667 from Comcast/topic/fix-v6-parsing
  • fix: Merge pull request #706 from Comcast/topic/fix-dnstest
  • change: Add 'Reformat with scalafmt 3.9.7' to .git-blame-ignore-revs
  • change: Add NetworkInterface(s)
  • change: Add NetworkInterface.fromJava
  • change: Add SocketAddress.port
  • change: Add UnixSocketAddress and GenSocketAddress, add Wildcard aliases for hosts and socket addresses
  • change: Add asIpUnsafe to GenSocketAddress
  • change: Add debug to failing test
  • change: Add support for scope ids to Ipv6Address
  • change: Add various utility functions to NetworkInterfaces
  • change: Bump base version to 3.6
  • change: Bump base version to 3.7
  • change: Bump base version to 3.8
  • change: Change GenSocketAddress to an abstract class
  • …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

Comcast/ip4s 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 712db03c0754fec0e44c18b4b455c7882b0bbca1 — 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.