analyze_code
Analyzes code to detect smells like long methods and large classes, then suggests refactorings to address them.
Instructions
Analyze code for smells and suggest refactorings.
Detects code smells like long methods, large classes, feature envy, and suggests appropriate refactorings to address them.
Note: This feature requires backend support. Returns backend_supported: false for backends that don't implement analysis yet.
Args: path: File or directory path to analyze smells: Optional list of smell types to check for (e.g., ['long-method', 'large-class', 'feature-envy'])
Returns: TOON-formatted string with analysis results.
Supported smell types (when backend supports analysis): - long-method: Method exceeds line threshold - large-class: Class has too many responsibilities - feature-envy: Method uses another class's data excessively - data-clumps: Same data items appear together repeatedly - primitive-obsession: Overuse of primitives instead of objects - duplicate-code: Similar code in multiple locations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| smells | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |