milessabin/shapeless
56.6
Adequate · 27 September 2026
20.7k
lines of production code
Scala
primary language
4
measurements over time
What this system is
This system is a Scala library providing advanced generic programming and type-level computation capabilities. It enables automatic derivation of type classes for case classes and sealed traits, supports complex structural operations like deep traversal and type-level arithmetic, and facilitates interoperability with Scala 2.13's by-name implicit changes. The library also includes utilities for runtime reflection, serialization, and managing heterogeneous data structures.
How it got here
2011 — Project initialization and build modernization
5 changes.
The repository was initialized with core configuration files, documentation, and build infrastructure, establishing the project's foundation. Experimental HList and polymorphic function implementations were removed to streamline the codebase, while the build system was upgraded to SBT 1.13.0 with modernized plugins and updated Scala versions.
2012–2016 — macro infrastructure overhaul and test expansion
5 changes.
This period focused on a major refactoring of the core library to introduce a robust macro-based derivation system and expand generic type-class facets. Comprehensive test suites were added to validate these new core operations, while new examples and utility scripts were provided to demonstrate advanced type-level programming capabilities.
2018–2024 — Scala 2.13 compatibility and macro fixes
4 changes.
This period focused on ensuring compatibility with Scala 2.13 by updating the Shapeless plugin to handle by-name implicits and adding serialization test utilities for the new standard library collections. It also fixed the @generateGeneric macro to correctly support Generic derivation in nested case class companion objects.
Features
Added scripts for automated Shapeless REPL sessions and SBT configuration
The repository now includes a new \scripts/try-shapeless.sh\ shell script that bootstraps the Coursier launcher and starts an Ammonite REPL pre-loaded with Shapeless 2.3.10 for Scala 2.13, allowing users to quickly experiment with the library. Additionally, a \scripts/dot-sbtrc\ file has been added to define an SBT alias that automatically reloads the build and switches to the \coreJVM\ project.
scripts · high confidence
New examples demonstrating type-level programming and structural operations
Added a suite of new Scala examples in the \examples\ directory illustrating advanced Shapeless capabilities, including a la carte case class emulation with caching (\alacache\, \alacarte\), type-level backtracking for genealogical relationships (\backtracking\), functional updates and merging of sealed and open case class families (\basecopy\, \caseclassmerge\), CSV serialization with optional fields (\csv\), deep traversal of recursive structures (\deephlister\, \deepsearch\), structural delta computation (\delta\), type class derivation for complex ADTs (\derivation\), safe enum implementation via ADTs (\enum\), and type-level arithmetic for factorials and Fibonacci numbers (\factorial\, \fibonacci\).
examples · high confidence
Project initialization and repository setup
This change establishes the initial state of the repository by adding core project files including the Apache 2.0 LICENSE, a comprehensive list of CONTRIBUTORS, and a README.md documenting the library's usage with SBT and Maven. It also introduces configuration files such as .gitignore to manage workspace artifacts, .codecov.yml for coverage thresholds, and .jvmopts for JVM settings, while removing legacy Eclipse project files (.classpath, .project).
(repo-wide) · high confidence
Removals
Removal of experimental HList and polymorphic function infrastructure
The experimental HList implementation and its associated polymorphic function support have been removed from the source code. This deletion eliminates the \Rank2Poly\ trait for higher-rank polymorphic function application, the \HList\/\HCons\/\HNil\ data structures, and the implicit conversions between tuples and HLists defined in \conversions.scala\. Consequently, users can no longer utilize the \map\, \foldLeft\, or \tupled\ operations on these heterogeneous lists, nor can they use the \HListFn\ abstraction to lift standard functions into the HList context.
src · high confidence
Behavioural changes
Major library overhaul: new macro infrastructure and expanded type-class facets
The core shared library has been significantly refactored to support more robust macro-based derivation and a richer set of generic type classes. A new \MacroState\ utility has been introduced to manage macro state safely across compiler runs, avoiding race conditions. The \Generic\ and \LabelledGeneric\ systems have been updated to better handle nested case classes and capture implicit parameters at materialization time. New facets have been added to \alacarte.scala\, providing automatic derivation for \ApplyUnapply\, \Product\, \PolymorphicEquality\, \Copy\, and \ToString\ behaviors on case classes. Additionally, \annotation.scala\ now supports \TypeAnnotations\ and variable annotations, while \default.scala\ offers new \AsRecord\ and \AsOptions\ views for default values. Underlying constraint type classes (\UnaryTCConstraint\, \BasisConstraint\, \LUBConstraint\, \KeyConstraint\, \ValueConstraint\) have been restructured for better type-level safety.
core/shared/src/main · high confidence
Removed Eclipse Scala IDE compiler preferences
The project-specific compiler configuration file for the Scala IDE (org.scala-ide.sdt.core.prefs) has been removed. This file previously contained various compiler flags, including experimental features and warning settings, which are no longer managed at this location.
.settings · high confidence
Shapeless plugin adds Scala 2.13+ by-name to lazy conversion
The plugin now includes a new \ShapelessPlugin\ implementation that handles the migration of by-name implicits to \shapeless.Lazy\ and \shapeless.Strict\ types. For Scala 2.13 and later, the plugin transforms \shapeless.Lazy\ and \shapeless.Strict\ usages into native by-name implicits, while for Scala 2.12 and earlier, it performs the reverse conversion, turning by-name implicits into \shapeless.Lazy\ wrappers. This ensures compatibility with the language changes regarding by-name parameters in Scala 2.13.
plugin · high confidence
Support for Generic derivation in nested case class companion objects
The \@generateGeneric\ macro annotation now correctly handles nested case classes by ensuring the \Generic\ type class is materialized within the companion object. Previously, this derivation worked for top-level case classes and sealed traits but failed for nested ones; the updated macro implementation explicitly targets the companion object (\ModuleDef\) to inject the \Generic\ instance, enabling seamless generic programming for deeply nested data structures.
coreTestMacros/shared · high confidence
Test coverage
Added comprehensive test suites for core Shapeless operations; Added serialization and runtime reflection tests for Shapeless core types; Added serialization test utilities for Scala 2.13+; Added tests for lazy type-class cycle breaking and serialization utilities.
Dependencies
Build infrastructure updated to SBT 1.13.0 with modernized plugin versions
The build system has been upgraded to SBT 1.13.0, accompanied by significant updates to key plugins including sbt-scalajs (1.22.0), sbt-scala-native (0.5.12), sbt-ci-release (1.12.1), and sbt-mima-plugin (1.2.1). The project now utilizes sbt-github-actions (0.32.1) for CI workflows and sbt-osgi (0.10.0) for OSGi metadata generation. Additionally, a new \Boilerplate.scala\ script has been introduced to automatically generate repetitive Scala code for arities up to 22, reducing manual maintenance of tuple, function, and polymorphic instances.
project · high confidence
Updated Scala versions to 2.12.21 and 2.13.18
The build configuration has been updated to use Scala 2.12.21 and 2.13.18 as the supported cross-compilation versions. This ensures the library is built against the latest patch releases for these major Scala versions, incorporating upstream bug fixes and improvements.
(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 42 → 57 (+14.9)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 94 (-6.2)
- Architecture 97 (new)
- Maturity 50 → 54 (+3.8)
- Readiness 30 → 46 (+16.0)
- Security 42 → 65 (+23.6)
Resolved (15)
- Dimension evaluation failed
- 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)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No artifact signing
- No automated tests
- No exposed public API
- No tests found
- Test reliability not included
- The README links only to an incomplete built-with-shapeless list and a clipped feature overview; there are no usage examples or an API reference in the visible portion of the document. (README.md)
- The README mentions a migration guide but does not state which version it is for or where to find the documentation. (README.md)
New (43)
- CaseClassMacros.ctorsOfAux (cognitive 63) (core/shared/src/main/scala/shapeless/generic.scala)
- CaseClassMacros.ctorsOfAux (cyclomatic 23) (core/shared/src/main/scala/shapeless/generic.scala)
- Concentrated knowledge decay
- DefaultMacros.materialize (cognitive 21) (core/shared/src/main/scala/shapeless/default.scala)
- Duplicated block (15 lines × 2) (examples/src/main/scala/shapeless/examples/sybclass.scala)
- Duplicated block (5 lines × 2) (plugin/src/main/scala_2.13+/shapeless/ShapelessPlugin.scala)
- Duplicated block (6 lines × 2) (core/shared/src/main/scala/shapeless/lenses.scala)
- Duplicated block (6 lines × 2) (core/shared/src/main/scala/shapeless/ops/records.scala)
- FileTooLong: ops/coproduct.scala (core/shared/src/main/scala/shapeless/ops/coproduct.scala)
- FileTooLong: ops/hlists.scala (core/shared/src/main/scala/shapeless/ops/hlists.scala)
- FileTooLong: ops/tuples.scala (core/shared/src/main/scala/shapeless/ops/tuples.scala)
- FileTooLong: shapeless/generic.scala (core/shared/src/main/scala/shapeless/generic.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/labelledgeneric.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/product.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/product.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/product.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/product.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/product.scala)
- FixmeComment (core/shared/src/test/scala/shapeless/product.scala)
- FromTo.of (cognitive 17) (core/shared/src/main/scala/shapeless/generic.scala)
- …and 23 more
Changes since last survey
- 14 commits — 14 feature/other, 0 fixes
By area
- project/plugins.sbt — 10 commits
- project/build.properties — 2 commits
- (root) — 1 commit
- .github/workflows — 1 commit
Notable commits
- change: Update sbt, scripted-plugin to 1.12.15 (#1463)
- change: Update sbt, scripted-plugin to 1.13.0 (#1467)
- change: Update sbt-api-mappings to 3.1.0 (#1478)
- change: Update sbt-buildinfo to 0.13.2 (#1477)
- change: Update sbt-ci-release to 1.12.1 (#1466)
- change: Update sbt-git to 2.2.0 (#1476)
- change: Update sbt-github-actions to 0.32.0 (#1469)
- change: Update sbt-github-actions to 0.32.1 (#1473)
- change: Update sbt-mima-plugin to 1.2.0 (#1474)
- change: Update sbt-mima-plugin to 1.2.1 (#1479)
- change: Update sbt-scala-native-crossproject, ... to 1.4.0 (#1465)
- change: Update scala-parser-combinators to 2.5.0 (#1475)
- change: Update slf4j-nop to 2.0.19 (#1472)
- change: Update slf4j-nop to 2.0.20 (#1481)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
milessabin/shapeless 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 de22d6a0a698328219fe5a9469fdbba5581fd190 — 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.