Analyze the following code using these examples as reference. ## Examples **Example 1:** Code: `def add(a, b): return a + b` Analysis: Simple pure function, O(1) complexity, no side effects, type hints missing. **Example 2:** Code: `def fetch_user(id): return db.query(users).filter(id=id).first()` Analysis: Database query function, O(1) lookup assuming indexed, side effect: DB access, exception handling missing. **Example 3:** Code: `async def process(items): return await asyncio.gather(*[handle(i) for i in items])` Analysis: Async batch processor, O(n) concurrent operations, memory scales with batch size, error propagation needs review. ## Code to Analyze {{code_snippet}} ## Analysis Requirements {{analysis_focus}} Provide analysis following the example format, covering: - Functionality summary - Complexity analysis - Side effects - Potential issues
Few-Shot Code Analysis Template
U
@
Few-shot code analysis template with reference examples for systematic evaluation of functionality, complexity, and potential issues.
13 copies0 forks
Details
Category
CodingUse Cases
Code analysisCode reviewQuality assessment
Works Best With
claude-sonnet-4-20250514gpt-4o
Created Shared