Skip to content
CAI
Software that uses CAICheck a score

ankane/chartkick

57.4

Adequate · 14 November 2026

204

lines of production code

Ruby

with JavaScript

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is the Chartkick Ruby gem, a library that provides helper methods for rendering various chart types such as line, pie, and bar charts. It integrates with JavaScript charting libraries like Chart.js and supports multiple web frameworks including Rails and Sinatra. The codebase focuses on secure asset management, CSP nonce support, and robust data serialization for web applications.

Removals

Removal of legacy Chartkick.js implementation

The legacy \app/assets/javascripts/chartkick.js\ file has been removed. This file contained a custom, self-contained implementation of Chartkick that relied exclusively on Google Charts to render Line, Pie, and Column charts. Its removal indicates that the application no longer supports this specific bundled JavaScript library, likely shifting to a different charting solution or a newer version of the library managed elsewhere.

app/assets · high confidence

Behavioural changes

Chartkick upgraded to v5.2.1 with CSP nonce support and importmap compatibility

This update upgrades the Chartkick library to version 5.2.1, introducing significant changes to how charts are rendered and integrated. The helper methods now support Content Security Policy (CSP) nonces, automatically detecting and applying nonces from Rails 5.2+ or Secure Headers to script tags, which improves security compliance. Additionally, the engine has been updated to support importmap-rails by conditionally adding assets to the precompile list only when both Importmap and Sprockets are defined, while also adding new core extensions for JSON serialization and utility functions for deep merging and JSON escaping. The version bump reflects these structural and security enhancements.

lib/chartkick · high confidence

Support for Sinatra, global options, and safer ActiveSupport loading

Chartkick now supports Sinatra applications in addition to Rails, with the Sinatra integration loaded only when the framework is detected. The library introduces global configuration options accessible via \Chartkick.options\ and a new \content\_for\ setting to control how JavaScript assets are rendered. Additionally, the initialization logic has been updated to safely include the helper module using \ActiveSupport.on\_load\, preventing exceptions if ActiveSupport is only partially loaded.

lib · high confidence

Updated Chart.js to v4.6.1

The vendored Chart.js library has been upgraded from version 4.5.1 to 4.6.1. This update introduces new configuration options for doughnut and polar area charts, specifically adding a \spacingMode\ property (defaulting to 'angular') alongside the existing \spacing\ option, allowing users to control whether spacing between segments is calculated proportionally or angularly. The release also includes internal improvements to arc pathing logic to handle full circles and spacing more robustly, as well as minor fixes to canvas resizing and variable naming.

build · high confidence

Test coverage

Initial test suite for Chartkick helper methods

Added a new test suite (\test/chartkick\_test.rb\) covering the core chart helper methods (line, pie, column, bar, area, scatter, geo, timeline) and validating key behaviors such as data escaping to prevent XSS, option immutability, width/height validation, nonce injection, deferred loading deprecation, content\_for support, default options, automatic chart ID generation, and JSON serialization.

test · high confidence

Dependencies

Updated Chart.js to 4.5.1 and modernized Ruby gem configuration

The JavaScript build now uses Chart.js 4.5.1 (along with @kurkle/color 0.3.2, chartjs-adapter-date-fns 3.0.0, and date-fns 2.30.0) via a new build/package.json, replacing the previous bundling approach. On the Ruby side, the gemspec has been cleaned up to specify a single author and email, set the homepage to https://chartkick.com, restrict the required Ruby version to \>= 3.2, and move development dependencies (minitest, rake) into the Gemfile.

(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 58 → 57 (-0.7)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 60 → 57 (-3.1)
  • Architecture 69 → 69 (+0.0)
  • Maturity 59 → 59 (+0.0)
  • Readiness 51 → 51 (+0.0)
  • Security 100 → 100 (+0.0)

Resolved (2)

  • Scanner failed to run — not a clean result
  • Scanner failed to run — not a clean result

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

Survey your own repository

ankane/chartkick 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 14 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 f76411d94eb824d4dd6ee5f4cb29a3002f32c653 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — 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.65+preprod-36d4cd83012f.