Skip to content

Commit 6cffbfe

Browse files
committed
docs: update project description to reflect insight features
1 parent e356602 commit 6cffbfe

10 files changed

Lines changed: 55 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
run: |
181181
cat > homebrew-tap/Formula/codelens.rb << 'FORMULA'
182182
class Codelens < Formula
183-
desc "High performance code statistics tool written in Rust"
183+
desc "High performance code analysis tool — stats, health scores, hotspots, and trends"
184184
homepage "https://github.com/DropFan/codelens"
185185
version "VERSION_PLACEHOLDER"
186186
license "MIT"

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Codelens
22

3-
High performance code statistics tool written in Rust.
3+
High performance code analysis tool written in Rust — stats, health scores, hotspots, and trends.
44

55
## Features
66

@@ -9,6 +9,9 @@ High performance code statistics tool written in Rust.
99
- **Smart Filtering**: Respects `.gitignore`, auto-excludes build directories
1010
- **Multiple Outputs**: Console, JSON, CSV, Markdown, HTML with charts
1111
- **Complexity Analysis**: Function count, cyclomatic complexity, nesting depth
12+
- **Health Score**: Project/directory/file-level health grading (A-F) with pluggable scoring models
13+
- **Hotspot Detection**: Identify risky files via churn × complexity analysis
14+
- **Trend Tracking**: Save snapshots and compare codebase evolution over time
1215
- **Extensible**: Add custom languages via TOML configuration
1316

1417
## Installation
@@ -61,6 +64,37 @@ codelens --exclude vendor,dist,node_modules
6164
codelens --list-languages
6265
```
6366

67+
### Health Score
68+
69+
Score code health across five dimensions (complexity, function size, comment ratio, file size, nesting depth) with grades from A to F.
70+
71+
```bash
72+
codelens health . # Project, directory, and file-level report
73+
codelens health . --top 20 # Show top 20 worst files
74+
codelens health . -f json # Output as JSON
75+
```
76+
77+
### Hotspot Detection
78+
79+
Find the riskiest files by combining git change frequency (churn) with code complexity — files that change often AND are complex are the most likely sources of bugs.
80+
81+
```bash
82+
codelens hotspot . # Last 90 days (default)
83+
codelens hotspot . --since 30d # Last 30 days
84+
codelens hotspot . --since 6m --top 5 # Last 6 months, top 5
85+
```
86+
87+
### Trend Tracking
88+
89+
Save snapshots and compare codebase evolution over time. Snapshots are stored in `.codelens/snapshots/`. Use `latest`, `latest~N`, or a date prefix like `2025-01-01` as references.
90+
91+
```bash
92+
codelens trend --save --label v1.0 # Save a labeled snapshot
93+
codelens trend # Compare latest two snapshots
94+
codelens trend --list # List all snapshots
95+
codelens trend --compare latest~2 latest # Compare specific snapshots
96+
```
97+
6498
## Output Formats
6599

66100
| Format | Flag | Description |

crates/codelens-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codelens-core"
3-
description = "Core library for codelens - high performance code statistics tool"
3+
description = "Core library for codelens - high performance code analysis tool"
44
version.workspace = true
55
edition.workspace = true
66
rust-version.workspace = true

crates/codelens-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! # codelens-core
22
//!
3-
//! Core library for codelens - a high performance code statistics tool.
3+
//! Core library for codelens - a high performance code analysis tool.
44
//!
55
//! ## Features
66
//!

crates/codelens-core/templates/report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ <h2>By Language</h2>
230230
</section>
231231

232232
<footer>
233-
<p>Generated by <strong>Codelens</strong> in {{ elapsed_secs }}s | High-performance code statistics tool powered by Rust</p>
233+
<p>Generated by <strong>Codelens</strong> in {{ elapsed_secs }}s | High-performance code analysis tool powered by Rust</p>
234234
</footer>
235235
</div>
236236

crates/codelens/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codelens"
3-
description = "High performance code statistics tool written in Rust"
3+
description = "High performance code analysis tool — stats, health scores, hotspots, and trends"
44
version.workspace = true
55
edition.workspace = true
66
rust-version.workspace = true

crates/codelens/src/cli.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ const STYLES: Styles = Styles::styled()
1111
.literal(AnsiColor::Cyan.on_default().effects(Effects::BOLD))
1212
.placeholder(AnsiColor::Cyan.on_default());
1313

14-
/// High performance code statistics tool.
14+
/// High performance code analysis tool.
1515
#[derive(Parser, Debug)]
1616
#[command(
1717
name = "codelens",
1818
author,
1919
version,
20-
about = "High performance code statistics tool",
20+
about = "High performance code analysis tool — stats, health scores, hotspots, and trends",
2121
styles = STYLES,
2222
after_help = EXAMPLES,
2323
)]
@@ -42,10 +42,20 @@ pub struct Cli {
4242
#[derive(Subcommand, Debug)]
4343
pub enum Command {
4444
/// Analyze code health score.
45+
#[command(long_about = "Score code health across five dimensions: complexity, function size, \
46+
comment ratio, file size, and nesting depth. Reports at project, directory, and file \
47+
levels with grades from A (best) to F (worst). Use --top to control how many items \
48+
are shown per level.")]
4549
Health(HealthArgs),
4650
/// Detect change hotspots (churn x complexity).
51+
#[command(long_about = "Find the riskiest files in your codebase by combining git change \
52+
frequency (churn) with code complexity. Files that change often AND are complex are \
53+
the most likely sources of bugs. Requires a git repository.")]
4754
Hotspot(HotspotArgs),
4855
/// Track codebase trends with snapshots.
56+
#[command(long_about = "Save snapshots of codebase metrics and compare them over time. \
57+
Snapshots are stored in .codelens/snapshots/ as JSON files. References: \"latest\", \
58+
\"latest~N\" (Nth before latest), or date prefix like \"2025-01-01\".")]
4959
Trend(TrendArgs),
5060
}
5161

crates/codelens/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Codelens CLI - High performance code statistics tool.
1+
//! Codelens CLI - High performance code analysis tool.
22
33
mod cli;
44

docs/RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ cargo install codelens
230230
Formula 模板 (`codelens.rb`):
231231
```ruby
232232
class Codelens < Formula
233-
desc "High performance code statistics tool"
233+
desc "High performance code analysis tool — stats, health scores, hotspots, and trends"
234234
homepage "https://github.com/DropFan/codelens"
235235
version "0.1.0"
236236
license "MIT"

templates/report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ <h2>By Language</h2>
230230
</section>
231231

232232
<footer>
233-
<p>Generated by <strong>Codelens</strong> in {{ elapsed_secs }}s | High-performance code statistics tool powered by Rust</p>
233+
<p>Generated by <strong>Codelens</strong> in {{ elapsed_secs }}s | High-performance code analysis tool powered by Rust</p>
234234
</footer>
235235
</div>
236236

0 commit comments

Comments
 (0)