Skip to main content

DEFAULT_MAX_AST_FILE_BYTES

Constant DEFAULT_MAX_AST_FILE_BYTES 

pub const DEFAULT_MAX_AST_FILE_BYTES: usize = _; // 2_097_152usize
Expand description

Maximum source-file size in bytes that we’ll feed to tree-sitter for complexity / clones extraction at HEAD. Files larger than this are skipped with a tracing-debug log entry and excluded from AST-based metrics.

2 MB covers real hand-written source (Linux’s block.c ~195 KB; V8 monorepo’s largest hand-written .cc ~1.5 MB) while reliably catching the common offenders: minified JS bundles (5–50 MB), protobuf-generated .pb.cc (often 10+ MB), and vendored single-file libraries (sqlite3.c is ~9 MB). Without this cap tree-sitter occasionally hits stack-overflow or OOM on deeply-nested generated code; the cap turns those failures into graceful skips.