Skip to main content

Crate hotspots_core

Crate hotspots_core 

Source
Expand description

Hotspots core library - static analysis for TypeScript, JavaScript, Go, Java, Python, and Rust

Re-exports§

pub use callgraph::CallGraph;
pub use config::ResolvedConfig;
pub use git::GitContext;
pub use report::render_json;
pub use report::render_text;
pub use report::render_text_grouped;
pub use report::sort_reports;
pub use report::FunctionRiskReport;
pub use snapshot::TouchMode;

Modules§

aggregates
Aggregation views - expose architectural concentration
analysis
Analysis orchestration - ties together parsing, discovery, CFG, metrics, and reporting
ast
AST adapter layer for function discovery
callgraph
Call graph extraction and analysis
cfg
Control Flow Graph (CFG) construction and analysis
compact
Compaction of snapshot history to reduce storage
config
Configuration file support for Hotspots
coupling
Directed coupling signal — F37/F38/F39.
db
SQLite-backed snapshot storage.
delta
Parent-relative delta computation
discover
Function discovery from AST
gate
Suppression gate: detect when the activity-based ranker has failed on this repo and recommend falling back to a code-semantic classifier.
git
Git context extraction
history_signals
Cold-start history signals — F63 signal-porting prerequisite.
html
HTML report generation
imports
Import extraction and file-level dependency resolution
isolation_forest
From-scratch IsolationForest for the F62/F63 cold-start anomaly route.
language
Language detection and abstraction layer
metrics
Metric extraction from AST and CFG
models
Model risk map extraction and aggregation.
parser
TypeScript and JavaScript parser using SWC
patterns
Pattern classification engine
phrases
Deterministic phrase table for the --explain output layer.
policy
Policy engine for CI enforcement
prune
Reachability pruning for snapshot history
report
Reporting and output generation
risk
Local Risk Score (LRS) calculation
sarif
SARIF 2.1.0 output for GitHub code scanning integration
scoring
Activity-weighted risk scoring
snapshot
Snapshot container and persistence
suppression
Suppression comment extraction
touch_cache
On-disk cache for per-function git touch metrics.
trainer
hotspots train — fit a local RandomForest ranker from git history.
trends
Trend semantics - extract high-signal trends from snapshot history

Structs§

AnalysisOptions

Functions§

analyze
Analyze files at the given path with default configuration
analyze_with_config
Analyze files at the given path with optional resolved configuration
analyze_with_progress
Like analyze_with_config but accepts an optional progress callback.
build_call_graph
Build a call graph from AST-derived callee names in function reports.
build_call_graph_from_db
Build a call graph from lean DB rows instead of full FunctionRiskReport slices.