Go code analyzer that finds code smells and roasts them with AI.
godepvis is a static analysis tool for Go that detects common code smells, anti-patterns, and potential bugs. It then uses AI (Claude, GPT, or local Ollama models) to generate humorous "roasts" of your code problems.
Key features:
- Detects 26 types of code issues
- Supports multiple LLM providers (Anthropic Claude, OpenAI GPT, Ollama)
- Works offline with Ollama
- Adjustable roast intensity (gentle, normal, savage)
- Multi-language roasts (English, Russian)
- MCP integration for Claude Code
Prerequisites: Go 1.21 or later
go install github.com/aqylsoft/godepvis/cmd/godepvis@latestVerify installation:
godepvis --helpgodepvis --dry .# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull a model and start
ollama pull llama3.2
ollama serve
# Run godepvis
godepvis .# Set your API key
export ANTHROPIC_API_KEY=your-key-here
# or
export OPENAI_API_KEY=your-key-here
# Run godepvis
godepvis .| Flag | Description | Example |
|---|---|---|
--dry |
Preview issues without LLM roasting | godepvis --dry . |
--savage |
No mercy mode - maximum roast intensity | godepvis --savage . |
--gentle |
Be nicer - reduced roast intensity | godepvis --gentle . |
--lang |
Roast language (en, ru) | godepvis --lang ru . |
--max |
Maximum issues to report | godepvis --max 10 . |
--file |
Analyze a single file | godepvis --file main.go |
--provider |
Force specific LLM provider | godepvis --provider ollama . |
--mcp |
Run as MCP server | godepvis --mcp |
godepvis detects 26 types of code smells:
| Emoji | Type | Description |
|---|---|---|
| π | huge_function |
Function exceeds 50 lines |
| π | huge_main |
main() exceeds 80 lines |
| πͺ | deep_nesting |
Nesting depth greater than 4 |
| ποΈ | god_struct |
Struct with more than 15 fields |
| π | god_interface |
Interface with more than 5 methods |
| π | too_many_params |
Function with more than 7 parameters |
| π¬ | init_function |
init() function in library code |
| π | global_var |
Global mutable variable |
| π«£ | naked_return |
Return without explicit values in long functions |
| Emoji | Type | Description |
|---|---|---|
| π | ignored_error |
Error silently discarded with _ |
| π£ | panic_in_lib |
panic() call in library code |
| Emoji | Type | Description |
|---|---|---|
| π | hardcoded_secret |
Hardcoded password, token, or API key |
| π | sql_concat |
SQL query built with string concatenation |
| π | exec_command |
exec.Command with variable argument |
| β³ | http_no_timeout |
http.Client without Timeout |
| π | tls_insecure |
TLS InsecureSkipVerify enabled |
| Emoji | Type | Description |
|---|---|---|
| π | defer_in_loop |
defer statement inside a loop |
| β° | time_equal |
time.Time compared with == instead of .Equal() |
| π» | range_pointer |
Pointer to range loop variable |
| π | context_background |
context.Background() when ctx parameter available |
| Emoji | Type | Description |
|---|---|---|
| π | todo_comment |
TODO/FIXME comment left in code |
| πΎ | select_star |
SELECT * in SQL query |
| π’ | magic_number |
Unexplained numeric literal |
| π§ͺ | no_tests |
Package has no test files |
| π | string_concat_loop |
String concatenation in loop (use strings.Builder) |
$ godepvis --dry .
π Scanning for sins...
π Found 5 sins across 12 files
--- DRY RUN ---
π cmd/main.go:42 β error silently discarded with _
π internal/parser/parser.go:15 β func Parse is 78 lines long
πͺ internal/handler/handler.go:33 β func Handle has nesting depth of 6
π config/config.go:8 β hardcoded credential in source code
π§ͺ internal/util/util.go:1 β entire package has zero test files$ godepvis .
π Scanning for sins...
π Found 3 sins across 8 files
π₯ Roasting 3 sins with anthropic...
cmd/main.go (2 sins)
π line 42 [ignored_error]
"Oh, you're just going to ignore that error? Bold strategy,
Cotton. Let's see if it pays off when your app crashes at 3 AM."
π line 15 [huge_function]
"This function is so long it needs its own zip code.
Ever heard of single responsibility? Neither has this code."
ββββββββββββββββββββββββββββββββββββββββββββββββββ
π ROAST COMPLETE
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Files analyzed : 8
Sins found : 3
Code Quality : 94/100 ACCEPTABLE (suspicious)
Top offender : cmd/main.go (2 sins)
Most common : π ignored_error (1x)
ββββββββββββββββββββββββββββββββββββββββββββββββββgodepvis can run as an MCP (Model Context Protocol) server for integration with Claude Code.
- Add to your Claude Code configuration (
~/.config/claude-code/claude_desktop_config.json):
{
"mcpServers": {
"godepvis": {
"command": "godepvis",
"args": ["--mcp"]
}
}
}-
Restart Claude Code
-
Use the tool in Claude Code:
- Ask Claude to analyze your Go code
- Request specific sin type checks
- Get code improvement suggestions
| Tool | Description |
|---|---|
analyze_code |
Analyze Go code for common issues and code smells |
list_sin_types |
List all detectable issue types with descriptions |
Q: Why is it called godepvis?
A: It started as a Go dependency visualizer (go-dep-vis), but evolved into a code analyzer with attitude.
Q: Is it free?
A: The analyzer itself is free. You only pay for LLM API usage if using Claude or GPT. Ollama is completely free and runs locally.
Q: What LLMs are supported?
A: Anthropic Claude (claude-3-sonnet), OpenAI GPT (gpt-4o), and any Ollama model (default: llama3.2).
Q: How do I ignore certain sins?
A: Currently there's no ignore mechanism. All detected issues are reported. This is intentional - the tool is meant to be provocative.
Q: Does it work on Windows?
A: Yes, but you'll need to ensure Go is installed and in your PATH. Ollama also supports Windows.
Q: Can I use it in CI/CD?
A: Yes! Use --dry mode for CI pipelines. Exit code is 0 even when sins are found (it's a roasting tool, not a linter).
MIT