Expand description
§Valknut-RS: High-Performance Code Analysis Engine
A Rust implementation of the valknut code analysis platform, designed for superior performance and memory safety. This library provides comprehensive code analysis capabilities including:
- Statistical Analysis: Bayesian normalization and feature scoring
- Graph Analysis: Dependency graphs, centrality metrics, and cycle detection
- Similarity Detection: LSH-based duplicate detection and MinHash signatures
- Refactoring Analysis: Code smell detection and refactoring opportunities
- Multi-language Support: Python, JavaScript, TypeScript, Rust, Go
§Performance Features
- Zero-cost abstractions with compile-time optimizations
- SIMD-accelerated mathematical computations
- Lock-free concurrent data structures
- Memory-efficient probabilistic algorithms
- Async-first design for I/O operations
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ API Layer │
├─────────────────────────────────────────────────────────────┤
│ Core Engine │ Detectors │ Language │ I/O & Reports │
│ │ │ Adapters │ │
│ • Scoring │ • Graph │ • Python │ • Cache │
│ • Bayesian │ • LSH/Hash │ • JS/TS │ • Reports │
│ • Pipeline │ • Structure │ • Rust │ │
│ • Config │ • Coverage │ • Go │ │
└─────────────────────────────────────────────────────────────┘§Quick Start
use valknut_rs::{ValknutEngine, AnalysisConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = AnalysisConfig::default()
.with_language("python")
.enable_all_modules();
let mut engine = ValknutEngine::new(config).await?;
let results = engine.analyze_directory("./src").await?;
println!("Analysis completed: {} files processed", results.files_analyzed());
Ok(())
}Re-exports§
pub use crate::core::pipeline::AnalysisResults;pub use api::config_types::AnalysisConfig;pub use api::engine::ValknutEngine;pub use core::errors::Result;pub use core::errors::ValknutError;pub use core::errors::ValknutResultExt;
Modules§
- api
- High-level API and engine interface.
- core
- Core analysis algorithms and data structures.
- detectors
- Specialized code analysis detectors.
- doc_
audit - Documentation and README audit utilities.
- features
- Build-time feature detection Runtime feature detection.
- io
- I/O operations, caching, and report generation.
- lang
- Language-specific parsing and AST processing modules.
- oracle
- AI Refactoring Oracle - Gemini integration for intelligent refactoring suggestions
Macros§
- valknut_
error - Helper macro for creating context-aware errors
Constants§
- VERSION
- Library version information