jashkenas/underscore
62.4
Adequate · 13 November 2026
16.5k
lines of production code
JavaScript
primary language
7
measurements over time
What this system is
This system is the Underscore.js utility library, providing a collection of functional programming helpers for JavaScript arrays, collections, and objects. It has been modernized to support native ES modules alongside CommonJS and UMD formats, enabling tree-shaking and selective imports. The codebase includes a comprehensive QUnit-based test suite and utilizes Rollup for bundling to ensure compatibility and performance across various environments.
Security
Security advisory for Underscore.js template injection
The documentation and code comments for \\_.template\ now explicitly warn about the risk of code injection, directing users to the project's security policy for safe usage guidelines.
(repo-wide) · high confidence
Behavioural changes
Underscore.js modularized into ES modules with IE11 and security fixes
The library has been split into individual ES modules, enabling tree-shaking and selective imports. This release includes a fix for [CVE redacted] by making the internal flatten function iterative to prevent stack overflows, and adds a fingerprinting heuristic to correctly identify Map, WeakMap, and Set objects in IE 11.
modules · high confidence
Workaround for docco build issue via patch-package
A patch has been added to resolve a build problem in the docco documentation generator by modifying how the 'marked' library is imported within the node\_modules directory, ensuring the correct function is accessed.
patches · high confidence
Test coverage
Initial test suite for Underscore.js; Modularized test-treeshake entry points for tree-shaking evaluation; Updated QUnit test framework to version 2.10.1.
Dependencies
Add ESM support and modern build tooling
Underscore now supports native ES modules alongside its existing CommonJS and UMD formats. A new \modules/package.json\ declares the module type, and the main \package.json\ exports are configured to serve the appropriate bundle (ESM, CJS, or UMD) based on the consumer's environment. The build system has been upgraded to use Rollup for bundling and Terser for minification, replacing previous tools, and a \package-lock.json\ has been added to ensure deterministic dependency resolution.
(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 59 → 62 (+3.8)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.
Lenses
- Code Health 68 → 67 (-0.9)
- Architecture 100 → 100 (+0.0)
- Maturity 46 → 51 (+5.6)
- Readiness 75 → 67 (-7.7)
- Security 67 → 82 (+14.8)
- Accessibility 68 → 80 (+12.6)
Resolved (11)
- Direct functional overlap with different return semantics. where returns an array of all matching elements, while findWhere returns the first matching element. They share the exact same signature for the input (obj, attrs). This is a classic 'plural vs singular' naming inconsistency that is often better handled by a single method with an option or distinct names like findAll vs findFirst.
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High secret: WD-SECRET-0005 (package-lock.json)
- Inconsistent naming convention for type-checking predicates. Most follow the isX pattern (e.g., isObject, isNull), but isMatch deviates by using a verb-noun structure instead of isMatching or similar, and more importantly, it takes two arguments while others take one. While the signature difference is functional, the naming isMatch suggests a boolean check on a single object's properties rather than a comparison between two objects, which is confusing compared to isEqual.
- Inconsistent naming for array slicing operations. first and last are intuitive, but initial (all but last) and rest (all but first) are less intuitive and inconsistent with the first/last naming scheme. rest is often called tail in other libraries (like Lodash), and initial is sometimes dropLast. The use of guard parameter is also inconsistent with modern JS practices (default parameters).
- Off-boarding risk: anonymized user #1
- Redundant and confusingly named search operations. find and findKey are nearly identical in signature and intent (finding the first element/key matching a predicate), differing only in return type (value vs key). findWhere is a specialized version of find that matches against an object of attributes (shorthand for a predicate). Having three distinct methods for 'finding' creates cognitive load. findWhere is essentially find with a specific predicate generator.
- Redundant extraction functionality. pluck is a specialized form of map that extracts a property. mapObject is a specialized form of map for objects. Having pluck as a separate method is redundant since map can achieve the same result. Similarly, mapObject is redundant if map handles objects correctly (which it does in Underscore).
- Rotate the exposed credentials — git history can't be un-committed
New (6)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- Low CVE: [GHSA redacted] (package-lock.json)
- Off-boarding risk: anonymized user #1
- redundant comment (test/objects.js)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
jashkenas/underscore 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 13 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 5c1e5f686f8500af9c9d15614ed60289d6d35d6b — the exact code this score is about.
- Scored under rubric-2026.11.3 — 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.63+preprod-4a8cc97a9484.