Skip to content
CAI
Software that uses CAICheck a score

lloydmeta/enumeratum

63.8

Adequate · 27 September 2026

5.3k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This release modernizes the project with a new SBT build system and adds comprehensive support for Scala 3 alongside Scala 2.12/2.13. It introduces a robust core API featuring case-insensitive lookups, value-based enums for primitive types, and extensive integration modules for JSON (Circe, Play, Argonaut, Json4s), databases (Slick, Doobie), and web frameworks (Play, ReactiveMongo). The update also includes new benchmarking capabilities, improved macro implementations, and significant test coverage across all platforms.

Features

Add Argonaut JSON serialization support for Enumeratum enums

This change introduces new Scala source files in the enumeratum-argonaut module that provide automatic JSON encoding and decoding for Enumeratum enums using the Argonaut library. The diff shows the addition of \ArgonautEnum\ and \Argonauter\ for standard enums, as well as \ArgonautValueEnum\ and \Argonauter\ for value-based enums (Int, Long, Short, String, Char, Byte). This allows users to easily serialize and deserialize their enum instances to and from JSON strings or numbers, with support for case-insensitive decoding and various case transformations (lowercase, uppercase).

enumeratum-argonaut/src/main · high confidence

Add Circe serialization support for value-based enums

New \Circe.scala\ and \CirceValueEnum.scala\ files introduce automatic JSON encoding and decoding for value-based enumerations (Int, Long, Short, String, Char, and Byte) in the \enumeratum-circe\ module. Users can now seamlessly serialize and deserialize these enums to and from JSON using the Circe library, with specific handling for string keys via \KeyEncoder\ and \KeyDecoder\ for string-based enums.

enumeratum-circe/src/main/scala/enumeratum/values · high confidence

Add JMH benchmarks for Enumeratum and standard library enums

Added a new benchmarking module that measures the performance of Enumeratum's enum features against Java's standard library enums. The suite includes benchmarks for name-based lookups, value-based lookups, and comparisons of Set and Map operations, allowing users to evaluate the runtime characteristics of Enumeratum's \EnumEntry\, \IntEnum\, and \Enum\ implementations.

benchmarking · high confidence

Add Json4s serialization support for Enumeratum enums

Added Json4s integration for Enumeratum enums, providing \serializer\ and \keySerializer\ methods to enable custom JSON serialization and deserialization of enum values as strings.

enumeratum-json4s/src/main/scala/enumeratum · high confidence

Add Play form, path, and query string binders for enums

The enumeratum-play module now provides built-in support for binding enums in Play Framework forms, URL paths, and query strings. Developers can extend PlayEnum, PlayLowercaseEnum, or PlayUppercaseEnum to automatically gain PathBindable, QueryStringBindable, and Form field capabilities. Additionally, value-based enums (Int, Long, Short, String, Char, Byte) gain corresponding Play\*Enum traits that include form and URL binders. This reduces boilerplate when integrating enumeratum with Play's request handling and form binding.

enumeratum-play/src/main · high confidence

Add Play-JSON serialization support with case-insensitive and case-transformed formats

The enumeratum-play-json module now provides comprehensive JSON serialization for enumerations, including case-insensitive reads and writes, as well as formats that automatically convert to or from lowercase and uppercase strings. Users can now easily integrate enumerations with Play-JSON by mixing in traits like PlayInsensitiveJsonEnum, PlayLowercaseJsonEnum, or PlayUppercaseJsonEnum, or by using the new EnumFormats object for manual configuration of reads, writes, and formats.

enumeratum-play-json/src/main/scala/enumeratum · high confidence

Add Quill integration for Enum and ValueEnum types

Adds new \QuillEnum\ and \QuillValueEnum\ traits and companion objects that provide implicit \MappedEncoding\ instances for all Enumatum enum types (String, Int, Long, Short, Char, and Byte). This enables seamless serialization and deserialization of Enumatum enums in Quill database queries, allowing users to store and retrieve enum values directly in their database models without manual conversion.

enumeratum-cats, enumeratum-quill, enumeratum-scalacheck · high confidence

Add ReactiveMongo BSON serialization for Enum types

The EnumHandler object and ReactiveMongoBsonEnum trait are introduced to provide automatic BSON serialization and deserialization for Enum entries when using ReactiveMongo. This adds support for reading and writing enum values as strings in MongoDB, with options for case-insensitive matching and case-transformed (lowercase/uppercase) storage and retrieval.

enumeratum-reactivemongo-bson/src/main/scala/enumeratum · high confidence

Add ReactiveMongo BSON serialization for value enums

Added support for serializing and deserializing value-based enums (Int, Long, Short, String, Char, Byte) with ReactiveMongo. The new \BSONValueHandlers\ provide implicit \BSONHandler\ instances for primitive types, while \EnumHandler\ and \ReactiveMongoBsonValueEnum\ traits automatically supply \BSONReader\, \BSONWriter\, \KeyReader\, and \KeyWriter\ for value enums, enabling seamless storage and retrieval of these enums in MongoDB.

enumeratum-json4s/src/main/scala/enumeratum/values, enumeratum-reactivemongo-bson/src/main/scala/enumeratum/values · high confidence

Add Scala 3 macro implementations for Enum and ValueEnum

Added new Scala 3 macro implementations (EnumMacros.scala, ValueEnumMacros.scala) to support enum value discovery and value-based lookups in Scala 3. The EnumMacros implementation includes a compile-time warning when an enum object is nested inside a class or trait, as this pattern is problematic in Scala 3. The ValueEnumMacros implementation supports finding entries with literal value members for Int, Long, Short, String, Byte, and Char types, and handles constructors with default parameter values.

macros/src/main/scala-3 · high confidence

Add Slick integration for enumeratum and value-based enums

Added new support for mapping enumeratum enums and value-based enums to Slick database columns and plain SQL queries. The \SlickEnumSupport\ trait now provides \SlickEnumColumnSupport\ for standard enums and \SlickEnumPlainSqlSupport\ for plain SQL operations, enabling seamless integration with Slick's relational and JDBC capabilities. Similarly, \SlickValueEnumSupport\ adds \SlickValueEnumColumnSupport\ and \SlickValueEnumPlainSqlSupport\ for value-based enums, allowing users to easily map integer, long, short, string, byte, and char-based enums to database columns or plain SQL parameters.

enumeratum-slick/src/main · high confidence

Add ValueEnum support for primitive types with safe lookup methods

The library introduces a new \ValueEnum\ trait and associated entry types (\IntEnumEntry\, \StringEnumEntry\, etc.) that allow enums to be backed by primitive values (Int, Long, Short, String, Byte, Char). This enables more efficient lookups and pattern matching on primitive types. The \ValueEnum\ base trait provides three lookup methods: \withValue\ (throws exception if not found), \withValueOpt\ (returns Option), and \withValueEither\ (returns Either with a descriptive error). A new \NoSuchMember\ exception class is added to provide clear error messages when a value is not found.

enumeratum-core/src/main/scala/enumeratum/values · high confidence

Added Scala 2 macro implementations for Enum and ValueEnum

The macros/src/main/scala-2 directory now includes new macro implementations for Enum and ValueEnum. EnumMacros.scala provides the core logic for finding and validating sealed traits/classes and their subclasses, including warnings for nested enums. ValueEnumMacros.scala adds support for value enums with literal values of various types (Int, Long, Short, String, Byte, Char), including handling for aliases and uniqueness checks. These changes enable the library to generate enum value sequences at compile time for Scala 2.

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

Adds Circe integration for enum serialization and deserialization

The enumeratum-circe module now provides comprehensive support for serializing and deserializing Enum members using the Circe library. Users can easily convert enums to and from JSON strings with standard, lowercase, uppercase, and case-insensitive decoding options. Additionally, the module introduces implicit encoders and decoders via the CirceEnum and CirceKeyEnum traits, enabling seamless integration with Circe's type classes for both value and key serialization.

enumeratum-circe/src/main/scala/enumeratum · high confidence

Adds Doobie database integration for Enum types

Adds new Scala source files in the enumeratum-doobie module that provide database mapping support for EnumEntry and ValueEnumEntry types using the Doobie library. This includes a central Doobie object with meta mappings, a DoobieEnum trait for standard enums, and specific traits (IntDoobieEnum, LongDoobieEnum, ShortDoobieEnum, StringDoobieEnum, CharDoobieEnum, ByteDoobieEnum) for value-based enums, enabling seamless serialization and deserialization of enum instances to and from database columns.

enumeratum-doobie/src/main · high confidence

Adds Play JSON serialization support for value-based enums

The enumeratum-play-json module now provides built-in JSON serialization for enums backed by primitive types (Int, Long, Short, String, Char, and Byte). By extending the new PlayJsonValueEnum trait, developers can automatically derive Play JSON Reads, Writes, and Formats for these value enums, enabling seamless JSON encoding and decoding without manual implementation.

enumeratum-play-json/src/main/scala/enumeratum/values · high confidence

Adds Scala 3 support for enumeratum-core

New Scala 3-specific compatibility files are added to enumeratum-core, providing inline macro implementations for Enum, IntEnum, LongEnum, ShortEnum, StringEnum, ByteEnum, and CharEnum. This enables the library to function on Scala 3, where the previous Scala 2 macro-based approach required different syntax and inline definitions.

enumeratum-core/src/main/scala-3 · high confidence

Introduce core Enum and EnumEntry types with case-insensitive lookup and formatting traits

The library now provides a new core API in \enumeratum-core\, featuring an \Enum\ trait that supports case-insensitive lookups via \withNameInsensitive\ and \withNameInsensitiveEither\, as well as optimized index retrieval. Additionally, \EnumEntry\ is introduced with stackable traits for name formatting (e.g., \Snakecase\, \Camelcase\, \Uppercase\) and a helper \in\ method for checking membership.

enumeratum-core/src/main/scala/enumeratum · high confidence

Removals

Removal of core Enum trait

The core \Enum\ trait from the \enumeratum\ package has been removed from the codebase. This trait previously provided a mechanism for creating exhaustive pattern matching enumerations in Scala, including methods like \values\, \withName\, and \findValues\. Its removal indicates that this specific enumeration implementation is no longer part of the library.

src/main · high confidence

Removal of deprecated macro implementation

The file EnumMacros.scala, which contained the deprecated withNameImpl and findValuesImpl macro implementations, has been removed from the codebase. This cleanup eliminates legacy macro code that was marked for deletion, simplifying the library's internal structure.

macros/src/main/scala/enumeratum · high confidence

Behavioural changes

Added Scala 2.12 and 2.13 compatibility utilities

Added new ContextUtils implementations for Scala 2.12 and 2.13 to support macro-based features in those versions. This change introduces version-specific utility classes that provide consistent access to reflection APIs (such as TermName, companion symbols, and named argument extractors) across different Scala versions, enabling the library to function correctly on Scala 2.12 and 2.13.

macros/compat · high confidence

Added aggregate project directories for ScalaJS and JVM libraries

New directories (circe, core, macros, upickle) and a note file were added to the aggregates folder. These changes establish the structure for SBT aggregate projects, enabling ScalaJS and JVM libraries to be published side by side with proper platform-specific artifact names.

aggregates · high confidence

Modernize build system and add automated test generation

The project has been migrated from the legacy \project/Enumeratum.scala\ build definition to a modern \build.sbt\-based structure, upgrading the SBT version from 0.13.6 to 1.12.11 and replacing the \sbt-scalariform\ plugin with \sbt-scalafmt\. Additionally, a new \CoreJVMTest\ build script was added to automatically generate and run randomized unit tests for various enum types, improving test coverage for the core library.

project · high confidence

Project modernized with new build configuration and AI agent documentation

The project has been modernized with a new \.scalafmt.conf\ file (Scalafmt 3.8.6, Scala 2.13/3 dialects) and updated \.gitignore\ rules. Additionally, new \AGENTS.md\ and \CLAUDE.md\ files were added to provide comprehensive guidance for AI agents working on the codebase. The \README.md\ was also significantly expanded to include detailed usage examples, integration documentation, and build instructions.

(repo-wide) · high confidence

Support for duplicate values in value enums

The library now allows defining multiple enum entries with the same underlying value. This is enabled by extending the new \AllowAlias\ marker trait. When multiple entries share a value, calling \withValue\ for that value will return one of the matching entries, though the specific one returned is undefined.

macros/src/main/scala/enumeratum/values · high confidence

Test coverage

Add test models for various enum case transformations; Added JVM-specific test suite for enumeratum; Added JVM-specific tests for ValueEnums; Added Play value enum tests; Added Scala 3-specific test coverage for enum hierarchies and type parameters; Added compilation tests for FindValEnums macro; Added comprehensive test coverage for Enum lookup and case-conversion methods; Added comprehensive test coverage for value-based enums; Added test helpers for Scala 2.13 and Scala 3; Added tests for Argonaut JSON serialization; Added tests for Circe enum serialization and deserialization; Added tests for Circe serialization of value-based enums; Added tests for Play enum form and URL binding; Added tests for Play-JSON serialization and deserialization; Added tests for Play-JSON serialization of value enums; Added tests for ReactiveMongo BSON serialization; Added tests for ReactiveMongo BSON value enum handlers; Added tests for Slick enum support; Removed obsolete test suite for Enum.

Dependencies

Migrate build system to SBT with multi-platform support

The project build has been migrated to SBT, enabling cross-compilation for JVM, JavaScript, and Native platforms. The new build configuration supports Scala versions 2.12, 2.13, and 3.3.8, and includes integration modules for libraries such as Circe, Play, Slick, Doobie, and Quill.

(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

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 48 → 64 (+16.2)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 96 (-4.3)
  • Architecture 69 → 100 (+31.0)
  • Maturity 51 → 65 (+13.3)
  • Readiness 30 → 53 (+23.7)
  • Security 75 → 68 (-6.7)

Resolved (9)

  • Dimension evaluation failed
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No automated tests
  • No exposed public API
  • No tests found
  • Test reliability not included

New (20)

  • Duplicated block (12 lines × 4) (enumeratum-play-json/src/main/scala/enumeratum/PlayInsensitiveJsonEnum.scala)
  • Duplicated block (5 lines × 3) (enumeratum-play/src/main/scala/enumeratum/UrlBinders.scala)
  • EnumMacros.enclosedSubClassTrees (cognitive 21) (macros/src/main/scala-2/enumeratum/EnumMacros.scala)
  • EnumMacros.enclosedSubClasses (cognitive 37) (macros/src/main/scala-3/enumeratum/EnumMacros.scala)
  • EnumMacros.enclosedSubClasses (cyclomatic 19) (macros/src/main/scala-3/enumeratum/EnumMacros.scala)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium: security finding (details withheld)
  • No SBOM
  • No build provenance
  • Orphaned files with no living knowledge
  • Unpinned build actions
  • ValueEnumMacros.findValueEntriesImpl (cognitive 61) (macros/src/main/scala-3/enumeratum/ValueEnumMacros.scala)
  • ValueEnumMacros.findValueEntriesImpl (cyclomatic 34) (macros/src/main/scala-3/enumeratum/ValueEnumMacros.scala)
  • ValueEnumMacros.toTreeWithMaybeVals (cognitive 21) (macros/src/main/scala-2/enumeratum/ValueEnumMacros.scala)
  • ValueEnumMacros.toTreeWithMaybeVals (cyclomatic 26) (macros/src/main/scala-2/enumeratum/ValueEnumMacros.scala)
  • Workflow token permissions not restricted

Architecture

  • Containers 0 added · 0 removed · contexts 1 added · 0 removed · edges 0 added · 0 removed

Added bounded contexts (1)

  • repository

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

Survey your own repository

lloydmeta/enumeratum 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 27 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 d85dd13dc43b4402f1c7fc0746e4092ca20c26c7 — 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-d00c643c3f66.