code-analyze-core
Core library for code structure analysis using tree-sitter.
Features
- Directory analysis - File tree with LOC, function, and class counts
- File analysis - Functions, classes, and imports with signatures and line ranges
- Symbol call graphs - Callers and callees across a directory with configurable depth
- Module index - Lightweight function and import index (~75% smaller than full file analysis)
- Multi-language - Rust, Python, TypeScript, TSX, Go, Java, Fortran
- Pagination - Cursor-based pagination for large outputs
- Caching - LRU cache for parsed results with mtime-based invalidation
- Parallel - Rayon-based parallel file analysis
Installation
Add to your Cargo.toml:
[]
= "0.2"
Example
use ;
use Result;
async
Supported Languages
| Language | Extensions |
|---|---|
| Rust | .rs |
| Python | .py |
| TypeScript | .ts, .tsx |
| Go | .go |
| Java | .java |
| Fortran | .f, .f77, .f90, .f95, .f03, .f08, .for, .ftn |
Configuration
AnalysisConfig provides resource limits for library consumers:
use AnalysisConfig;
let config = AnalysisConfig ;
Support
For questions and support, visit clouatre.ca.
License
Apache-2.0. See LICENSE.