-
-
Notifications
You must be signed in to change notification settings - Fork 0
CodeComplexity Tool
Eshan Roy edited this page Jun 18, 2026
·
1 revision
The CodeComplexity tool analyzes a Go codebase and produces a complexity report with file counts, line counts, top packages, and a complexity score.
Source: internal/tools/codecomplexity.go
| Property | Value |
|---|---|
| Risk Level | safe |
| Schema | {skip_dirs?: string[]} |
-
File scanning -- Recursively scans
.gofiles in the project directory - Line counting -- Counts non-empty lines per file and per package
- Package ranking -- Ranks packages by total lines of code
- File ranking -- Ranks individual files by line count
-
Complexity score -- Classifies the codebase as
low,medium, orhighcomplexity -
Skip directories -- Configurable directory skip list, merged with defaults (
node_modules,vendor, etc.)
/complexity
Runs the CodeComplexity tool and displays the report inline.
The LLM can invoke the tool directly:
{
"name": "CodeComplexity",
"skip_dirs": ["testdata", "fixtures"]
}The report includes:
- Total files and lines -- Overall codebase size
- Top packages -- Packages ranked by total lines
- Top files -- Individual files ranked by line count
-
Complexity score --
low(< 5K lines),medium(5K-50K),high(> 50K)
| Score | Lines of Code | Description |
|---|---|---|
low |
< 5,000 | Small codebase |
medium |
5,000 - 50,000 | Medium codebase |
high |
> 50,000 | Large codebase |
| File | Purpose |
|---|---|
internal/tools/codecomplexity.go |
Tool implementation (308 lines) |
internal/tools/codecomplexity_test.go |
Tests (342 lines) |
internal/tui/commands/commands_analysis.go |
/complexity slash command handler |