๐Ÿš€ Launch Special: 50% off with code LAUNCH50. Offer ends Dec 31, 2026Get Started

Code Analyzer

Static analysis for quantum-vulnerable cryptography in source code. Scans individual files or entire project directories with real-time streaming progress.

Supported Languages

LanguageExtensions
Python.py, .pyw, .pyi
JavaScript.js, .jsx, .mjs, .cjs
TypeScript.ts, .tsx
Java.java
C / C++.c, .cpp, .cc, .cxx, .h, .hpp, .hxx
C#.cs
Go.go
Rust.rs
Ruby.rb, .rbw
PHP.php, .php3, .php4, .php5
Kotlin.kt, .kts
Scala.scala, .sc
Swift.swift
Solidity.sol
COBOL.cob, .cbl, .cpy, .cobol
Elixir.ex, .exs
SQL.sql
HTML.html
Apex (Salesforce).cls, .trigger
Dart.dart
Lua.lua
Vue.vue
Certificates.pem, .crt, .cer, .p7b, .p7c
Config / Data.json, .yml, .yaml, .toml, .xml, .env, .envrc
Jsonnet.jsonnet, .libsonnet

What Gets Detected

Quantum-Vulnerable Algorithms (PQC Mode)

CategoryExamples detected
Asymmetric encryption / key exchangeRSA key generation, RSA-OAEP, PKCS#1, ECDH, ECDHE, DH, DHE, X25519, X448
Digital signaturesECDSA, DSA, RSA signatures, EdDSA
Weak hash functionsMD5, SHA-1, SHA-224, SHA-256 (Grover halves effective bits)
Weak symmetric encryptionAES-128, DES, 3DES, RC4, Blowfish
Deprecated TLSTLS 1.0, TLS 1.1, weak cipher suites, SSLv3
Hardcoded secretsPrivate keys, API tokens, cryptographic material embedded in source
Insecure randomMath.random(), random.random(), rand() used in cryptographic contexts
Key size issuesRSA < 4096, DH < 3072, ECC curves below P-384

Scanning a Project

File Selection

Configure which files are scanned in Settings โ†’ Code Analysis:

  • File Extensions โ€” select which extensions to include. Defaults to all supported languages. Deselect extensions to skip file types you don't care about.
  • Excluded Directories โ€” directories skipped during scanning. Defaults include node_modules, .git, venv, dist, build, __pycache__, and other common build/dependency directories.

Streaming Progress

Directory scans use Server-Sent Events (SSE) to stream results in real time. Files are processed in batches grouped by language so language-specific rules are applied correctly. Batch sizes adapt to project size:

Project sizeBatch size
โ‰ค 10 files5 files per batch
11โ€“50 files10 files per batch
51โ€“100 files15 files per batch
> 100 files25 files per batch

Findings appear in the UI as each batch completes. The progress bar shows files scanned vs total.

Cancellation

Click Cancel during a scan to stop it. Partial results are saved to history and marked as Partial โ€” findings collected up to the cancellation point are preserved and viewable.

Result Fields Explained

Finding Summary

FieldWhat it means
Total FindingsNumber of issues detected across all scanned files.
Files ScannedTotal number of files analyzed.
Files with IssuesNumber of files that had at least one finding.
FixableFindings that have an available fix โ€” either a rule autofix or an AI-generated fix.

Per-Finding Fields

FieldWhat it means
SeverityCRITICAL / HIGH / MEDIUM / LOW / WARNING / INFO. Set by the rule author based on exploitability and impact.
LineStart line number of the vulnerable code.
MessageHuman-readable description of the issue and why it is quantum-vulnerable, including the recommended migration.
ActionsFix generation buttons. See AI-Powered Fixes below.

Severity Levels

SeverityMeaning in quantum context
CRITICAL / ERRORAlgorithm is directly broken by Shor's algorithm (RSA, ECDSA, DH). Immediate migration required.
HIGH / WARNINGSignificant quantum risk โ€” weak key sizes, AES-128, SHA-256 in security-critical contexts.
MEDIUMModerate risk โ€” deprecated but not immediately broken algorithms, weak TLS configurations.
LOW / INFOBest practice violations, informational findings, algorithm lifecycle warnings.

AI-Powered Fixes

Requires an LLM API key configured in Settings โ†’ AI Configuration. Two modes are available, selectable in Settings:

ModeButton labelWhat it generates
AI Recommendation (default)Generate AI RecommendationInserts a single-line @TODO-pq comment above the vulnerable code describing the issue and the recommended PQC migration. Does not modify existing code.
AI Code FixGenerate AI Code FixReplaces the vulnerable code with a working PQC-safe implementation. Adds a @TODO-pq REPLACED: comment above the new code. Review carefully before applying โ€” the LLM works from ~30 lines of context.

If AI is disabled or no LLM key is configured, a Generate Recommendation button appears instead. This uses the rule autofix field (extra.fix) where available, or calls a backend rule-based recommender โ€” no LLM required.

Reviewing a Fix

  1. Click the generate button on any finding โ€” a loading indicator appears while the fix is generated
  2. Click View Recommendation or View AI Code Fix to review the diff
  3. Apply the changes manually to your code, or use Regenerate to produce a new suggestion
  4. Click Discard to remove the suggestion and start fresh

Rule Sources

Rules are bundled with the application and organized by language. No internet connection is required for scanning.

Adding Custom Rules

Place custom OpenGrep YAML rules in rules/custom-rules/. They are picked up automatically on the next scan. Example:

rules:
  - id: custom-weak-cipher
    pattern: Cipher.getInstance("DES")
    message: DES is quantum-vulnerable. Replace with AES-256-GCM.
    severity: ERROR
    languages: [java]
    metadata:
      quantum_vulnerable: true

Setting quantum_vulnerable: true in metadata ensures the finding appears in PQC-only scan mode.

Scan History

Every scan is saved to history. Directory scans are stored as a single record grouping all findings. Individual file scans are stored separately.

  • Complete scans โ€” all files processed, full findings available
  • Partial scans โ€” cancelled or errored scans, marked with a Partial badge. Findings collected before cancellation are preserved.
  • Clean files โ€” files with no findings are stored in a separate table and lazy-loaded on demand to keep scan records small

Performance Notes

  • The scanner is invoked once per language per batch โ€” not once per file. This is significantly faster than per-file invocation.
  • For large projects (>100 files), the scan runs as a single directory invocation per language group.
  • Scan timeout is 120 seconds by default. Individual batches have a 600-second hard timeout.
  • The scanner is bundled with the application for air-gapped environments โ€” no internet connection required for scanning.
  • The scanner ignores .gitignore by default so all files are scanned. Use the Excluded Directories setting to control what's skipped.

Relationship to Other Analyzers

The Code Analyzer finds quantum-vulnerable cryptography in source code โ€” before it is compiled. The Binary Analyzer finds the same vulnerabilities in compiled binaries โ€” useful when you don't have source access. For live infrastructure, the Certificate Analyzer and Network Analyzer assess deployed TLS configurations.

The Code Analyzer does not produce a 0โ€“100 Quantum Risk Score โ€” findings are reported at the individual rule level with severity. For a unified risk score, use the Certificate or Binary analyzers.