Skip to content
CAJ654Public

About

An AI coding tool that analyzes the code you provide it with to determine the level of complexity, the programming language, the patterns, semantic density, structural complexity, abstraction level, and pattern consistency

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

[DECIPHER]

Paste code. Get answers. No server. No sign-up. No trace.

A browser-native code analysis tool powered by CodeBERT and transformers.js.
Drop in any snippet and Decipher tells you what it is, what it does, and how complex it is — entirely on your machine.

Screenshot1

Screenshot2


What it does

Signal How
Language detection Heuristic scoring across 18+ languages with confidence %
Pattern recognition Flags loops, recursion, async, decorators, generics, closures and more
Complexity rating Cyclomatic analysis → SIMPLE / MODERATE / COMPLEX / VERY COMPLEX
Code breakdown Lines, functions, classes, imports, comments, TODOs
Semantic analysis CodeBERT embeddings surfaced as readable metrics

Supports Python, JavaScript, TypeScript, Java, C, C++, Rust, Go, PHP, Ruby, Swift, Kotlin, SQL, HTML, CSS, Bash, YAML, JSON — and counting.


How it works

No backend. No API calls. Your code never leaves the tab.

  • Language + pattern detection — regex heuristics with weighted scoring and disambiguation (TypeScript vs JS, C vs C++)
  • CodeBERT (Xenova/codebert-base) loads via transformers.js directly in the browser using WebAssembly + ONNX Runtime. The model runs locally after a one-time download (~450 MB, cached in your browser).
  • Semantic metrics are derived from the mean-pooled embedding vector, split into quadrants representing density, structure, abstraction, and consistency

Run it

Hosted on GitHub Pages — just open the URL and paste code.

To run locally:

git clone https://github.com/CAJ654/Decipher.git
cd Decipher
npx serve .

No build step. No dependencies to install. It's HTML, CSS, and a module script.


Stack

  • Vanilla JS (ES modules) + HTML + CSS
  • transformers.js — Xenova/codebert-base
  • JetBrains Mono
  • GitHub Pages

Deploy your own

Fork → Settings → Pages → Source: GitHub Actions.
Push to main and the included workflow handles the rest.


Design Decisions

Python is often thought of as the language of AI, and rightfully so, most models and libraries for AI and machine learning use Python, so why no python? Well Github only allows for JavaScript, HTML, and CSS in GitHub pages, so I would have to transpile Python code to JavaScript using GitHub actions and transpiled code is typically less optimized. Why a heuristic? Well initially I wanted the AI to output the percent values for the four bars all on its own, however this led to highly innacurate outputs because it is a lighter model that wasn't necessarily fine tuned for this.

// runs entirely in-browser  ·  no server  ·  no sign-up  ·  no data leaves your machine

About

An AI coding tool that analyzes the code you provide it with to determine the level of complexity, the programming language, the patterns, semantic density, structural complexity, abstraction level, and pattern consistency

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages