Skip to content
CAI
Software that uses CAICheck a score

hammerjs/hammer.js

51.9

Adequate · 1 October 2026

5.6k

lines of production code

JavaScript

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is Hammer.js, a JavaScript library designed for multi-touch gesture recognition. It processes input from touch, mouse, and pointer devices to detect and emit events for gestures such as taps, pans, swipes, pinches, and rotations. The library manages input normalization, state tracking for recognizers, and CSS touch-action handling to prevent browser scrolling conflicts.

Behavioural changes

Gesture recognizers rewritten in ES6 classes with improved state management and touch-action handling

The gesture recognition logic in \src/recognizers\ has been refactored from legacy code into modern ES6 classes, introducing a more robust state machine for handling touch and mouse events. This change brings several behavioral improvements: the \Tap\ recognizer now supports single, double, and triple taps via a configurable \taps\ option and interval; the \Press\ recognizer (renamed from \Hold\) now emits a \pressup\ event and uses a timer for state transitions; and the \Pan\ and \Swipe\ recognizers have corrected touch-action directions to prevent browser scrolling conflicts. Additionally, the \Swipe\ recognizer now uses overall gesture direction and velocity for more accurate detection, and the core \Recognizer\ class now uses \tryEmit\ to ensure required failures are met before emitting events.

src/recognizers · high confidence

Hammer.js 2.0.8 release

This update releases Hammer.js version 2.0.8, introducing several behavioral improvements and fixes. The library now includes a check to ensure required parameters are present in the Manager and fixes the restoration of Hammer.defaults.cssProps on destroy. Input handling has been improved by fixing the de-duplication of mouse events on touch-combo devices, and support has been added for a specific map of touch-action values. The release also includes the standard build artifacts (hammer.js, hammer.min.js) and configuration files (.bowerrc, .editorconfig, .gitignore, .jscsrc, .jshintrc, .travis.yml) necessary for the development and distribution of the library.

(repo-wide) · high confidence

Introduction of ES6 utility module library

The \src/utils\ directory has been populated with a new set of JavaScript utility modules, marking a shift to ES6 syntax and module standards. This update introduces default exports for functions handling object assignment (\assign\, \extend\, \merge\), DOM event management (\add-event-listeners\, \remove-event-listeners\), array and string manipulation (\each\, \in-array\, \unique-array\, \split-str\), and browser compatibility helpers (\prefixed\, \getWindowFor-element\). The codebase now utilizes \let\ and \const\ instead of \var\, strict equality checks, and arrow functions, while also providing polyfills for \Object.assign\ and deprecation warnings for legacy methods like \extend\ and \merge\.

src/utils · high confidence

Introduction of Hammer.js v2 with ES6 architecture and touch-action handling

This change introduces the initial v2 structure of the library, replacing the previous implementation with a modern ES6 class-based architecture. The core \Hammer\ and \Manager\ classes now utilize ES6 syntax and a new module system, with \main.js\ handling global and module exports. A significant behavioral addition is the new \TouchAction\ system, which automatically computes and applies CSS \touch-action\ properties (or polyfills them) based on the enabled recognizers to prevent browser scrolling conflicts. The default recognizer setup has been reorganized into a \preset\ configuration, and the \Hold\ gesture has been renamed to \Press\.

src · high confidence

Refactor input processing to ES6 classes and modern JavaScript syntax

The input processing logic in src/inputjs has been rewritten using ES6 class syntax (e.g., the Input constructor) and modern JavaScript features such as let/const, object destructuring, and strict equality checks. This refactoring introduces new helper modules for computing input data (like delta, velocity, scale, and rotation) and standardizes the input event handling flow, ensuring consistent behavior for gesture recognition while improving code maintainability.

src/inputjs · high confidence

Refactored input handling with dedicated modules for mouse, pointer, and touch events

The input subsystem has been restructured into distinct, modular components to improve maintainability and support modern input standards. Mouse input is now handled by a dedicated module that strictly enforces left-button-down state for start events. Pointer events are managed by a new module that normalizes standard Pointer Events while providing fallback support for IE10's prefixed MSPointerEvent, correctly mapping pointer types (touch, pen, mouse, kinect). Touch input is split into two handlers: a multi-touch handler that tracks target-specific touches across child elements, and a single-touch handler that simplifies processing when only one finger is active. Additionally, a combined touch-mouse handler has been introduced to prioritize touch input and de-duplicate synthetic mouse events generated by touch devices, preventing double-firing of gestures.

src/input · high confidence

Test coverage

Added manual test pages for gesture recognition and touch-action behavior; Expanded unit test coverage for gesture recognition and manager configuration.

Dependencies

Initial package.json for Hammer.JS v2.0.8

This change introduces the first package.json for the Hammer.JS library, establishing it as an npm package with version 2.0.8. It defines the project metadata, sets the main entry point to hammer.js, and configures development dependencies for building and testing, including Babel, Rollup, QUnit, and JSHint.

(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

Score

  • CAI 50 → 52 (+1.5)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 55 → 55 (+0.0)
  • Architecture 85 → 86 (+0.5)
  • Maturity 46 → 46 (+0.0)
  • Readiness 41 → 44 (+3.0)
  • Security 100 → 100 (+0.0)

Resolved (1)

  • Documentation: no licence statement (README.md)

New (2)

  • Low cohesion: Recognizer (LCOM4 4) (src/recognizerjs/recognizer-constructor.js)
  • Scanner failed to run — not a clean result

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

Survey your own repository

hammerjs/hammer.js 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 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit ff687ea0daa3c806b9accd2ecb1a46165ea3c00a — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.