| Crates.io | codelens-core |
| lib.rs | codelens-core |
| version | 0.0.1 |
| created_at | 2026-01-23 15:21:57.707922+00 |
| updated_at | 2026-01-23 15:21:57.707922+00 |
| description | Core library for codelens - high performance code statistics tool |
| homepage | https://github.com/DropFan/codelens |
| repository | https://github.com/DropFan/codelens.git |
| max_upload_size | |
| id | 2064740 |
| size | 158,505 |
High performance code statistics tool written in Rust.
.gitignore, auto-excludes build directoriesBuild from source:
git clone https://github.com/DropFan/codelens
cd codelens
cargo build --release
# Analyze current directory
codelens
# Analyze specific directories
codelens src tests
# Only count specific languages
codelens -l rust,go,python
# Output JSON
codelens -f json -O stats.json
# Output HTML report
codelens -f html -O report.html
# Show top 20 languages by code lines
codelens --top 20 --sort code
# Exclude directories
codelens --exclude vendor,dist,node_modules
# List supported languages
codelens --list-languages
| Format | Flag | Description |
|---|---|---|
| Console | -f console |
Colored terminal output (default) |
| JSON | -f json |
Structured data for processing |
| CSV | -f csv |
Spreadsheet compatible |
| Markdown | -f markdown |
Documentation friendly |
| HTML | -f html |
Interactive report with charts |
Create .codelens.toml in your project root:
# Exclude patterns
excludes = "*test*,*mock*"
# Target languages
lang = "rust,go,python"
# Output format
output = "json"
# Threading
threads = 8
# Depth limit
depth = 10
# Show git info
git_info = true
Note: This feature is planned but not yet implemented.
Custom language definitions will be supported in ~/.config/codelens/languages.toml:
[mylang]
name = "MyLang"
extensions = [".ml", ".mli"]
line_comments = ["#"]
block_comments = [["/*", "*/"]]
function_pattern = "^\\s*def\\s+\\w+"
complexity_keywords = ["if", "for", "while"]
Benchmarks on a large codebase (~100k files):
| Tool | Time |
|---|---|
| cloc (Perl) | ~60s |
| code-stats (Python) | ~45s |
| codelens (Rust) | ~1.5s |
MIT