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.
High-Performance Code Analysis for Modern Development Teams
Valknut provides comprehensive code analysis through advanced statistical algorithms and graph-based analysis. While other tools count lines and check syntax, Valknut analyzes code complexity, 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
Via Homebrew (macOS)
Via Cargo (recommended)
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
Statistical Code Analysis
Traditional tools analyze syntax. Valknut analyzes patterns and complexity. It uses advanced statistical algorithms to evaluate code structure, identify complexity hotspots, and detect architectural anti-patterns that impact maintainability.
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 Support
Comprehensive structural analysis for Python, TypeScript, JavaScript, Rust, Go, and more. Each language parser understands syntactic patterns and provides language-specific complexity 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
Code Quality Analysis: Statistical evaluation of code patterns and structural complexity
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:
Advanced Options
analysis:
enabled: true
complexity_threshold: 10.0
min_confidence: 0.65 # Analysis confidence threshold
include_test_files: true # Include test files in analysis
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: |
# Install from crates.io
cargo install valknut-rs
- 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
- Statistical Analysis: Advanced algorithms for code complexity evaluation
- 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 structural 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.