{
  "markdown": "\n<img width=\"336\" height=\"250\" alt=\"codehog_logo_small\" src=\"https://github.com/user-attachments/assets/01bbf4e5-6261-4f18-b23b-7a2df999857c\" />\n\n# 🐽 Code Hog - Your Friendly Code Smell Companion\n\nA friendly truffle pig that sniffs out design principle violations in your codebase.\n\nCode Hog is a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) plugin that analyzes your source files against established software design principles and reports findings with actionable suggestions — all in a constructive, encouraging tone.\n\n## What It Checks\n\n| Principle | What it catches |\n|-----------|----------------|\n| **Law of Demeter** | Excessive method chaining and deep property access |\n| **Single Responsibility** | Classes juggling too many concerns |\n| **Open/Closed** | Rigid if/else and switch statements on types |\n| **Liskov Substitution** | Unsupported operation errors and runtime type-checking |\n| **Interface Segregation** | Overly broad god interfaces |\n| **Dependency Inversion** | Hardcoded concrete dependencies |\n| **DRY** | Duplicate code blocks and magic numbers |\n| **KISS** | Excessive nesting, complex booleans, too many parameters |\n| **YAGNI** | Unused code and unreachable branches |\n| **Tell, Don't Ask** | Querying state then making decisions externally |\n| **Composition over Inheritance** | Deep inheritance hierarchies |\n\n## Install\n\nIn Claude Code, run:\n\n```\n/plugin marketplace add anthropics/claude-plugins-community\n/plugin install codehog@claude-community\n```\n\n\n## Usage\n\n```\n/codehog:codehog\n```\n\nTo scan a specific directory:\n\n```\n/codehog:codehog app/models\n```\n\nCode Hog will scan your project, identify the language(s), and produce a report organized by principle with impact levels (High / Medium / Low) and concrete suggestions for each finding.\n\n## Example Output\n\n```\n🐽 Code Hog is happily rooting through your codebase...\n\n## 🐽 app/services/order_processor.rb\n\n✅ Nice work: Clean method naming and good use of service objects!\n\n### 💎 Opportunity | Law of Demeter (line ~42)\nImpact: High — deep coupling makes this fragile when internals change\n\n  order.customer.address.country.tax_rate\n\nWhat's happening: This chain reaches through 4 objects — any change\nin the middle breaks this code.\nQuick win: Add a delegated method like order.tax_rate or pass the\nrate directly.\n\n### 💡 Suggestion | Single Responsibility (context)\nImpact: Medium — mixing concerns makes the class harder to test\n\nWhat's happening: This service handles payment processing, inventory\nupdates, and email notifications — three distinct responsibilities.\nQuick win: Extract PaymentHandler and InventoryUpdater, keep this\nclass as the orchestrator.\n\n### ✨ Polish | KISS (line ~87)\nImpact: Low — small change, nice readability boost\n\n  if !order.nil? && !order.cancelled? && order.items.any? && order.payment_status != :failed\n\nQuick win: Extract to a descriptive method like order.processable?\n\n---\n\n## Summary\n\n📊 What You're Doing Well\n- Consistent service object pattern across the app\n- Good test coverage in models\n- Clear naming conventions\n\nFiles sniffed: 12 | Opportunities: 8\n  💎 High: 2 | 💡 Medium: 4 | ✨ Low: 2\n\nRecommended Starting Points:\n1. app/services/order_processor.rb — highest concentration of findings\n2. app/models/user.rb — SRP violation easy to fix\n3. app/controllers/api/v1/products_controller.rb — deep nesting\n\nCleanest Files: app/models/product.rb, app/services/auth_service.rb\n\n🙂 Solid foundation! A handful of improvements would take this from good to great.\n```\n\n## Language Support\n\nRuby, JavaScript, TypeScript, Python, Java, Go, Rust, C#, and more.\n\n## License\n\n[MIT](LICENSE)\n",
  "bytes": 3639,
  "sha": "4fe33e8f0975537077a1ace933a96f9cd610b333d366dff44728090cc8f85801",
  "repo_slug": "ivannovosad/codehog",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_ivannovosad_codehog_codehog_21743674/readme"
}