Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
AI-Powered Code Analysis That Actually Understands Your Code
Valknut goes beyond traditional static analysis by using AI to understand the semantic meaning of your code. While other tools count lines and check syntax, Valknut analyzes naming quality, identifies architectural debt, and provides actionable refactoring recommendations with quantified impact. Built in Rust for production speed and integrated with CI/CD for automated quality gates.
Stop guessing what needs refactoring. Get data-driven insights that improve code maintainability.
Quickstart
Installation
# Build from source (requires Rust 1.70+)
Get Results in 30 Seconds
# Analyze your codebase and get actionable insights
# Generate team-friendly HTML report
# Set up CI/CD quality gates (fails build if thresholds exceeded)
That's it. Valknut will analyze your code structure, complexity, naming quality, and technical debt, then provide prioritized recommendations for improvement.
What Makes Valknut Different
AI-Powered Semantic Analysis
Traditional tools analyze syntax. Valknut analyzes meaning. It uses AI embeddings to evaluate whether function names match their actual behavior, identifying misleading identifiers that confuse developers and cause bugs.
Production-Ready Performance
Built in Rust with SIMD optimizations, Valknut analyzes large codebases in seconds, not minutes. Designed for enterprise-scale projects with 100k+ files while maintaining sub-linear memory usage.
Quantified Technical Debt
Get concrete metrics on technical debt with prioritized recommendations. Know exactly which refactoring will provide the highest impact and where to focus your team's effort.
Zero-Configuration CI/CD Integration
Drop into any CI/CD pipeline with quality gates that fail builds when code quality degrades. No complex setup required.
Multi-Language Intelligence
Deep semantic analysis for Python, TypeScript, JavaScript, Rust, Go, and more. Each language parser understands idiomatic patterns and provides language-specific insights.
Core Capabilities
Structure Analysis: Identifies architectural anti-patterns and organizational debt that impacts maintainability
Complexity Intelligence: Goes beyond cyclomatic complexity to measure cognitive load and refactoring priority
Semantic Naming Analysis: AI-powered evaluation of naming quality with context-aware suggestions
Refactoring Recommendations: Actionable insights with quantified impact scoring and effort estimation
Dependency Health: Detects circular dependencies, architectural chokepoints, and coupling hotspots
Technical Debt Quantification: Measurable debt metrics with ROI analysis for refactoring efforts
Configuration
Quick Setup
# Generate default configuration
# Validate configuration
# View all available options
Quality Gates for CI/CD
Configure automatic build failures when quality thresholds are exceeded:
quality_gates:
enabled: true
max_complexity: 75 # Fail if complexity score exceeds 75
min_health: 60 # Fail if health score drops below 60
max_debt: 30 # Fail if technical debt exceeds 30%
max_issues: 50 # Fail if more than 50 total issues
max_critical: 0 # Fail on any critical issues
Language-Specific Configuration
languages:
python:
enabled: true
complexity_threshold: 10.0
file_extensions:
typescript:
enabled: true
complexity_threshold: 10.0
file_extensions:
AI Semantic Analysis
names:
enabled: true
embedding_model: "Qwen/Qwen3-Embedding-0.6B-GGUF"
min_mismatch: 0.65 # Sensitivity threshold
protect_public_api: true # Avoid suggesting changes to public APIs
CI/CD Integration
GitHub Actions
name: Code Quality Gate
on:
jobs:
quality-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Valknut
run: cargo install --git https://github.com/nathanricedev/valknut
- name: Run Quality Gate
run: |
valknut analyze \
--quality-gate \
--max-complexity 75 \
--min-health 60 \
--format html \
--out quality-reports/ \
./src
- name: Upload Reports
uses: actions/upload-artifact@v3
if: always()
with:
name: quality-reports
path: quality-reports/
Jenkins Pipeline
pipeline
Development Workflow Integration
# Pre-commit hook
# Code review preparation
# Continuous monitoring
|
Advanced Usage
Output Formats
# Interactive HTML reports for teams
# Machine-readable JSON for automation
# Markdown reports for documentation
# CSV data for spreadsheet analysis
# SonarQube integration format
Advanced Analysis Options
# Custom configuration
# Specific analysis types
# Large codebase optimization
# Language-specific analysis
Legacy Command Support
# Structure-only analysis
# Dependency and clone analysis
Contributing & Development
Quick Development Setup
# Build and test
# Install language parsers
# Run on sample project
Project Architecture
Valknut uses a modular pipeline architecture:
- Core Pipeline: Orchestrates multi-stage analysis with caching
- Language Parsers: Tree-sitter based AST analysis for each supported language
- AI Integration: Embedding models for semantic naming analysis
- Report Generation: Templated output in multiple formats
- Quality Gates: Configurable thresholds for CI/CD integration
Contributing
We welcome contributions! Please:
- Add tests for new features
- Run
cargo clippyandcargo fmtbefore submitting - Update documentation for user-facing changes
- Benchmark performance-critical changes
- Follow Rust best practices and idioms
See docs/ for detailed architecture documentation and design decisions.
Supported Languages
Currently supported languages with full semantic analysis:
- Python - Comprehensive AST analysis with async/await pattern detection
- TypeScript/JavaScript - Modern ES features, React patterns, Node.js idioms
- Rust - Ownership analysis, zero-cost abstraction patterns
- Go - Concurrency patterns, interface analysis
- Java - OOP patterns, enterprise frameworks
- C/C++ - Memory management, performance patterns
Additional languages supported for basic complexity analysis. See valknut list-languages for the complete list.
Performance
Benchmarked on real-world codebases:
- 100k+ files: < 30 seconds full analysis
- Memory usage: < 2GB for large monorepos
- Parallel processing: Scales linearly with CPU cores
- Incremental analysis: 5x faster on subsequent runs
License
MIT License - see LICENSE file for details.
Ready to improve your code quality? Start with valknut analyze ./src and get actionable insights in seconds.