Boobesh007 commited on
Commit
f4ef8d1
·
verified ·
1 Parent(s): 89b1caf

Upload server/code_review_environment.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. server/code_review_environment.py +32 -0
server/code_review_environment.py CHANGED
@@ -10,6 +10,22 @@ except ImportError:
10
 
11
  TASKS = {
12
  "easy": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  {
14
  "code": "def add(a, b)\n return a + b",
15
  "language": "python",
@@ -98,6 +114,22 @@ TASKS = {
98
  },
99
  ],
100
  "hard": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  {
102
  "code": "def divide(a, b):\n return a / b",
103
  "language": "python",
 
10
 
11
  TASKS = {
12
  "easy": [
13
+ {
14
+ "code": "def greet(name)\n print('Hello ' + name)",
15
+ "language": "python",
16
+ "description": "Find syntax errors in this code",
17
+ "has_syntax_error": True,
18
+ "expected_issues": ["missing colon after function definition"],
19
+ "severity": "high"
20
+ },
21
+ {
22
+ "code": "for i in range(10)\n print(i)",
23
+ "language": "python",
24
+ "description": "Find syntax errors in this code",
25
+ "has_syntax_error": True,
26
+ "expected_issues": ["missing colon after for loop"],
27
+ "severity": "high"
28
+ },
29
  {
30
  "code": "def add(a, b)\n return a + b",
31
  "language": "python",
 
114
  },
115
  ],
116
  "hard": [
117
+ {
118
+ "code": "def divide(a, b):\n return a / b",
119
+ "language": "python",
120
+ "description": "Full review: find bugs, security issues and performance problems",
121
+ "has_syntax_error": False,
122
+ "expected_issues": ["division by zero", "no error handling"],
123
+ "severity": "high"
124
+ },
125
+ {
126
+ "code": "password = \"admin123\"\nif user_input == password:\n grant_access()",
127
+ "language": "python",
128
+ "description": "Full review: find bugs, security issues and performance problems",
129
+ "has_syntax_error": False,
130
+ "expected_issues": ["hardcoded password", "security risk"],
131
+ "severity": "high"
132
+ },
133
  {
134
  "code": "def divide(a, b):\n return a / b",
135
  "language": "python",