| Crates.io | valknut-rs |
| lib.rs | valknut-rs |
| version | 1.2.1 |
| created_at | 2025-09-09 19:19:33.54343+00 |
| updated_at | 2025-09-12 02:37:47.006468+00 |
| description | High-performance Rust implementation of valknut code analysis algorithms |
| homepage | |
| repository | https://github.com/nathanricedev/valknut |
| max_upload_size | |
| id | 1831417 |
| size | 2,314,099 |
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.
brew tap sibyllinesoft/valknut
brew install valknut
cargo install valknut-rs
git clone https://github.com/sibyllinesoft/valknut
cd valknut
cargo build --release
# Analyze your codebase and get actionable insights
./target/release/valknut analyze ./src
# Generate team-friendly HTML report
valknut analyze --format html --out reports/ ./src
# Set up CI/CD quality gates (fails build if thresholds exceeded)
valknut analyze --quality-gate --max-complexity 75 --min-health 60 ./src
That's it. Valknut will analyze your code structure, complexity, naming quality, and technical debt, then provide prioritized recommendations for improvement.
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.
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.
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.
Drop into any CI/CD pipeline with quality gates that fail builds when code quality degrades. No complex setup required.
Comprehensive structural analysis for Python, TypeScript, JavaScript, Rust, Go, and more. Each language parser understands syntactic patterns and provides language-specific complexity insights.
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
# Generate default configuration
valknut init-config --output .valknut.yml
# Validate configuration
valknut validate-config --config .valknut.yml
# View all available options
valknut print-default-config
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
languages:
python:
enabled: true
complexity_threshold: 10.0
file_extensions: [".py", ".pyi"]
typescript:
enabled: true
complexity_threshold: 10.0
file_extensions: [".ts", ".tsx"]
analysis:
enabled: true
complexity_threshold: 10.0
min_confidence: 0.65 # Analysis confidence threshold
include_test_files: true # Include test files in analysis
name: Code Quality Gate
on: [push, pull_request]
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/
pipeline {
agent any
stages {
stage('Code Quality Gate') {
steps {
sh '''
valknut analyze \
--quality-gate \
--max-issues 50 \
--max-critical 0 \
--format sonar \
./src
'''
}
}
}
}
# Pre-commit hook
valknut analyze --fail-on-issues ./src
# Code review preparation
valknut analyze --format markdown ./src > REVIEW.md
# Continuous monitoring
valknut analyze --format json ./src | jq '.health_score'
# Interactive HTML reports for teams
valknut analyze --format html --out reports/ ./src
# Machine-readable JSON for automation
valknut analyze --format json ./src
# Markdown reports for documentation
valknut analyze --format markdown ./src
# CSV data for spreadsheet analysis
valknut analyze --format csv ./src
# SonarQube integration format
valknut analyze --format sonar ./src
# Custom configuration
valknut analyze --config custom.yml ./src
# Specific analysis types
valknut analyze --skip-naming --skip-refactoring ./src
# Large codebase optimization
valknut analyze --max-files 50000 --parallel 8 ./src
# Language-specific analysis
valknut list-languages
# Structure-only analysis
valknut structure ./src --format pretty
# Dependency and clone analysis
valknut impact ./src --cycles --clones
git clone https://github.com/sibyllinesoft/valknut
cd valknut
# Build and test
cargo build
cargo test
# Install language parsers
./scripts/install_parsers.sh
# Run on sample project
cargo run -- analyze ./test_data/sample_python --format json
Valknut uses a modular pipeline architecture:
We welcome contributions! Please:
cargo clippy and cargo fmt before submittingSee docs/ for detailed architecture documentation and design decisions.
Currently supported languages with full structural analysis:
Additional languages supported for basic complexity analysis. See valknut list-languages for the complete list.
Benchmarked on real-world codebases:
MIT License - see LICENSE file for details.
Ready to improve your code quality? Start with valknut analyze ./src and get actionable insights in seconds.