๐งชTDD Challengeยทbeginnerยทโฑ๏ธ 15โ30mยทโญ 100 XP
M-082Build Your First Agentic Code Reviewer
Description
Nebula Corp wants an automated code review assistant that analyzes code snippets for common issues. Build a simple rule-based code reviewer that checks for common problems: console.log statements left in production code, TODO comments, functions that are too long, and missing error handling. The reviewer should return a structured list of findings with severity levels.
Test Cases (3)
Detects console.log
Should find the console.log on line 2
Input:reviewCode('function test() {\n console.log("debug");\n return 42;\n}')
Expected:CONTAINS:no-console
Detects missing error handling
Should flag missing try/catch
Input:reviewCode('function fetch() {\n return getData();\n}')
Expected:CONTAINS:error-handling
Formats review output
Should format findings with severity and summary
Input:formatReview([{ rule: 'no-console', severity: 'warning', message: 'Remove console.log before production', line: 3 }])
Expected:CONTAINS_ALL:[WARNING],Line 3,Found 1 issue(s)
Related Lessons
Click Run / Check to validate your solution