Perform comprehensive code analysis with quality metrics and recommendations
[file-or-directory-path]
macOS/Linux:
Windows:
macOS/Linux:
Windows:
Note: After installation, restart Claude Code to load the new command.
Slash command:
/code_analysis [file-or-directory-path]
Perform a comprehensive code analysis on the specified files or directory. If no path is provided, analyze the current working directory.
- Extract the path from $ARGUMENTS (defaults to current directory if not specified)
- Determine scope: single file, multiple files, or entire directory
- Identify programming language(s) based on file extensions
- Apply language-specific analysis rules
- **Complexity Metrics**: Cyclomatic complexity, nesting depth, function length
- **Code Smells**: Long methods, large classes, duplicate code patterns
- **Best Practices**: Naming conventions, code organization, documentation
- **Security Issues**: Common vulnerabilities, unsafe patterns, input validation
- **Performance**: Inefficient algorithms, memory leaks, blocking operations
- **Maintainability**: Code coupling, cohesion, test coverage indicators
- Summary with overall health score
- Detailed findings by category
- Priority-ranked issues (High/Medium/Low)
- Specific file and line references
- Actionable recommendations for improvement
- Create todos for high-priority issues found
- Organize by fix complexity and impact
Target path: $ARGUMENTS