code-smell-detector

Solid

Identify and report code smells indicating poor design or maintainability issues in Python code, including duplicate code, magic numbers, hardcoded values, God classes, feature envy, inappropriate intimacy, data clumps, primitive obsession, and long parameter lists. Use when conducting code quality audits, preparing for refactoring, improving codebase maintainability, or performing design reviews. Produces markdown reports with severity ratings, locations, descriptions, and specific refactoring recommendations with before/after examples. Triggers when users ask to find code smells, identify design issues, suggest refactorings, improve code quality, or detect maintainability problems.

Data & Documents 160 stars 17 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Code Smell Detector ## Overview Identify code quality and design smells in Python codebases, then provide specific refactoring recommendations to improve maintainability and design. ## Workflow ### 1. Understand the Analysis Scope Define what to analyze: **Questions to ask:** - What directory or files should be analyzed? - Focus on quality smells, design smells, or both? - Are there specific concerns (e.g., "this class is too complex")? - Should test files be included? **Determine scope:** ```bash # Check project structure ls -la # Count Python files find . -name "*.py" | wc -l # Identify large files (potential smells) find . -name "*.py" -exec wc -l {} + | sort -rn | head -10 ``` ### 2. Detect Code Smells Use multiple detection strategies. #### Strategy 1: Automated Detection Use the bundled script for AST-based analysis: ```bash # Scan entire project python scripts/detect_smells.py /path/to/project # Exclude specific directories python scripts/detect_smells.py /path/to/project venv,tests,docs ``` **What it detects:** - Long methods (>50 lines) - Too many parameters (>5) - Large classes (>15 methods) - God classes (>20 methods) - Magic numbers #### Strategy 2: Manual Code Review Read the code to identify design smells. See [smell-patterns.md](references/smell-patterns.md) for comprehensive catalog. **Look for:** **Code Quality Smells:** - Duplicate code blocks - Magic numbers (unexplained numeric literals) - Hardcoded values (paths, URLs, config) - Comm...

Details

Author
ArabelaTso
Repository
ArabelaTso/Skills-4-SE
Created
6 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

code-smells

Whole-repository design-smell review — detects *wrong engineering* by name: feature envy, data clumps, primitive obsession, shotgun surgery, divergent change, speculative generality, message chains, temporal coupling, flag arguments, global/mutable data, dead code, repeated switches that want to be polymorphism — every confirmed smell from the Fowler/Beck catalog and beyond, each mapped to a specific catalog refactoring (Extract Class, Move Function, Introduce Parameter Object, Replace Conditional with Polymorphism, …). Report-first; applies the approved refactorings only when invoked with `--fix`. Use whenever the user invokes /smells, says "code smells", "design smells", "bad design", "wrong engineering", "spaghetti code", "is this well engineered", "maintainability review", "why is this codebase hard to change", "what refactorings does this need", or asks for a Fowler-style review — even if they never say the word "smell". Boundaries: bug / perf / durability findings inside named files belong to `code-audi

0 Updated 1 weeks ago
Stoica-Mihai
Data & Documents Featured

smell

Detect software architecture bad smells, algorithmic complexity hotspots, and anti-patterns in a codebase. Produces a detailed markdown report identifying violations of architectural principles, design patterns, code quality, and performance complexity. Triggers on: smell, code smell, architecture smell, find anti-patterns, detect bad smells, complexity analysis, 代码坏味道, 架构坏味道, 反模式, 找出坏味道, 复杂度分析.

235 Updated 5 days ago
smallnest
AI & Automation Listed

code-smell-detection

Detects code smell, complexity violations, architectural boundary breaches, and dead code. Use for codebase quality scans.

2 Updated today
fworks-tech