▸case-08 Review this TypeScript module for type-safety issues:
```typescript
function processResponse(data: any): any {
return data.result.map((item: any) => item.value);
}
```
Format the response as a JSON dictionary containing a summary field, code quality score (0 to 100), and defect array with line numbers and severity levels. | fail→pass | 8,214 | 7,039 | -14% | 1 | 1 | 0% | 1,467 | 1,466 | -0% | 0 | 0 | — |
▸case-09 Review this C# database connection builder for security risks:
```csharp
public SqlConnection GetConnection() {
string connStr = "Server=db.example.com;Database=prod;User Id=admin;Password=SecretPassword123!";
return new SqlConnection(connStr);
}
```
Return a JSON assessment payload with overview summary, numeric quality rating (0-100), and actionable issues including severity and line numbers. | fail→pass | 10,327 | 13,773 | +33% | 1 | 1 | 0% | 1,244 | 1,699 | +37% | 0 | 0 | — |
▸case-01 Could you perform a static analysis review on my Python data processing script below?
```python
def process_user_data(data):
results = []
for item in data:
if 'id' in item:
query = "SELECT * FROM users WHERE id = " + str(item['id'])
# execute query
results.append(item)
return results
```
Please format your response as a JSON object containing a narrative overview summary, an array of detected issues specifying their severity, line number, and detailed explanation, and an overall numerical quality score from 0 to 100. | fail→pass | 9,542 | 5,862 | -39% | 1 | 1 | 0% | 1,844 | 1,307 | -29% | 0 | 0 | — |
▸case-02 Review this JavaScript async handler for potential memory leaks or logic bugs:
```javascript
async function fetchAndCache(url) {
let res = await fetch(url);
let data = await res.json();
globalCache[url] = data;
return data;
}
```
Return your evaluation as a JSON payload that includes a brief summary statement, an overall score on a 0-100 scale, and an array listing each problem with its severity level, line reference, and descriptive suggestion. | fail→pass | 8,875 | 7,786 | -12% | 1 | 1 | 0% | 1,687 | 1,587 | -6% | 0 | 0 | — |
▸case-03 I'd like a code review for this Rust configuration loader:
```rust
fn parse_config(path: &str) -> Result<Config, String> {
let content = std::fs::read_to_string(path).unwrap();
let cfg: Config = serde_json::from_str(&content).unwrap();
Ok(cfg)
}
```
Give me the assessment strictly in JSON format containing a high-level summary of the code's health, a numeric score out of 100, and a list of specific issues detailing severity rating, relevant line numbers, and actionable fixes. | fail→pass | 8,665 | 8,065 | -7% | 1 | 1 | 0% | 1,621 | 1,773 | +9% | 0 | 0 | — |
▸case-04 Please review this Go concurrency function for potential data races:
```go
func updateCount(cfg *Config) {
go func() {
cfg.Count++
}()
}
```
Return your analysis in a JSON string containing an overview summary key, a numeric evaluation score out of 100, and an array of detected problems with severity, line number, and explanation. | fail→pass | 7,405 | 6,523 | -12% | 1 | 1 | 0% | 1,376 | 1,369 | -1% | 0 | 0 | — |
▸case-05 Analyze this C++ pointer operation for potential runtime crashes:
```cpp
void printLength(const std::string* str) {
std::cout << str->length() << std::endl;
}
```
Provide the review as a JSON object with a brief overview, a quality score from 0 to 100, and a list of issues with line, severity, and details. | fail→pass | 6,485 | 6,902 | +6% | 1 | 1 | 0% | 1,150 | 1,486 | +29% | 0 | 0 | — |
▸case-06 Review this Java file reading method for unclosed stream vulnerabilities:
```java
public String readFile(String path) throws IOException {
FileInputStream fis = new FileInputStream(path);
byte[] data = new byte[fis.available()];
fis.read(data);
return new String(data);
}
```
Output a JSON formatted response with summary details, overall score (0-100), and specific defect listings with severity and line references. | fail→pass | 8,983 | 6,497 | -28% | 1 | 1 | 0% | 1,675 | 1,427 | -15% | 0 | 0 | — |
▸case-07 Perform a code evaluation on this Python exception handler:
```python
def parse_data(raw_str):
try:
return int(raw_str)
except:
return None
```
Return JSON output including a high-level summary, overall score between 0 and 100, and detailed issues with line location and severity ranking. | pass→pass | 7,742 | 6,035 | -22% | 1 | 1 | 0% | 1,376 | 1,349 | -2% | 0 | 0 | — |
▸case-10 Analyze this PHP dynamic code execution snippet:
```php
function runUserScript($code) {
eval($code);
}
```
Provide a JSON review containing a summary overview, quality score on a 0-100 scale, and an issue list with line numbers and severity classifications. | fail→pass | 7,703 | 6,909 | -10% | 1 | 1 | 0% | 1,347 | 1,462 | +9% | 0 | 0 | — |
▸case-11 Review this Ruby system execution snippet for security bugs:
```ruby
def clean_temp_files(filename)
system("rm -rf /tmp/" + filename)
end
```
Provide the output in JSON format with summary, quality score (0-100), and identified issues with line numbers and severity ratings. | fail→pass | 11,377 | 20,456 | +80% | 1 | 1 | 0% | 1,144 | 2,240 | +96% | 0 | 0 | — |
▸case-12 Evaluate this Swift closure for memory leak vulnerabilities:
```swift
class Controller {
var onComplete: (() -> Void)?
func setup() {
onComplete = {
self.updateUI()
}
}
func updateUI() {}
}
```
Return JSON output with a summary statement, total score (0-100), and issue array detailing line numbers and severity. | fail→fail | 7,357 | 5,847 | -21% | 1 | 1 | 0% | 1,274 | 1,261 | -1% | 0 | 0 | — |
▸case-13 Review this Bash script snippet for script execution hazards:
```bash
#!/bin/bash
remove_dir() {
dir=$1
rm -rf $dir/*
}
```
Provide JSON output containing overview text, total quality score (0-100), and an array of issues specifying severity and line numbers. | fail→fail | 8,461 | 9,175 | +8% | 1 | 1 | 0% | 1,376 | 1,447 | +5% | 0 | 0 | — |
▸case-14 Review this well-written Python dataclass for code quality:
```python
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class UserProfile:
user_id: int
username: str
email: str
display_name: Optional[str] = None
```
Provide a JSON analysis payload containing summary details, overall quality score (0-100), and issue items with line and severity. | pass→pass | 6,116 | 6,165 | +1% | 1 | 1 | 0% | 1,045 | 1,373 | +31% | 0 | 0 | — |
▸case-15 Perform a code analysis on this C function:
```c
void copy_input(char *user_input) {
char buffer[16];
strcpy(buffer, user_input);
}
```
Format your findings as JSON with an overview summary, score (0-100), and defect list containing severity and line numbers. | pass→pass | 10,103 | 6,432 | -36% | 1 | 1 | 0% | 1,739 | 1,290 | -26% | 0 | 0 | — |
▸case-16 Review this Kotlin coroutine for thread blocking issues:
```kotlin
suspend fun loadData(): String = withContext(Dispatchers.Default) {
Thread.sleep(5000)
"data"
}
```
Output a JSON object with a summary key, score key (0-100), and issues list with line and severity. | fail→pass | 5,927 | 6,343 | +7% | 1 | 1 | 0% | 1,041 | 1,306 | +25% | 0 | 0 | — |
▸case-17 Analyze this Python dictionary modification loop:
```python
def filter_scores(scores):
for key in scores:
if scores[key] < 50:
del scores[key]
return scores
```
Format the output as JSON with summary text, quality score (0-100), and issue array with line location and severity. | fail→fail | 7,403 | 6,817 | -8% | 1 | 1 | 0% | 1,215 | 1,451 | +19% | 0 | 0 | — |
▸case-18 Review this JavaScript deep merge function for security flaws:
```javascript
function merge(target, source) {
for (let key in source) {
target[key] = source[key];
}
return target;
}
```
Provide JSON containing a summary overview, quality score (0-100), and issue list with severity and line numbers. | fail→pass | 11,916 | 20,085 | +69% | 1 | 1 | 0% | 1,528 | 2,382 | +56% | 0 | 0 | — |
▸case-19 Review this SQL database query building procedure:
```python
def get_orders_by_email(email):
return f"SELECT * FROM orders WHERE LOWER(customer_email) = '{email.lower()}'"
```
Return JSON output with code overview summary, overall quality score (0-100), and list of identified flaws with line and severity. | fail→pass | 5,846 | 7,299 | +25% | 1 | 1 | 0% | 951 | 1,501 | +58% | 0 | 0 | — |
▸case-20 Refactor the following Python data processing function to eliminate SQL injection and use parameterized queries:
```python
def process_user_data(data):
results = []
for item in data:
if 'id' in item:
query = "SELECT * FROM users WHERE id = " + str(item['id'])
results.append(item)
return results
```
Provide the refactored Python code. | pass→fail | 6,606 | 8,869 | +34% | 1 | 1 | 0% | 1,179 | 1,769 | +50% | 0 | 0 | — |
▸case-21 Write unit tests using Jest for the following JavaScript caching helper:
```javascript
async function fetchAndCache(url, cache, fetcher) {
if (cache[url]) return cache[url];
const data = await fetcher(url);
cache[url] = data;
return data;
}
```
Output the test suite implementation. | pass→fail | 8,629 | 15,473 | +79% | 1 | 1 | 0% | 1,594 | 2,758 | +73% | 0 | 0 | — |
▸case-22 Generate Google-style docstrings and inline documentation for this Rust configuration parsing function:
```rust
fn parse_config(path: &str) -> Result<Config, String> {
let content = std::fs::read_to_string(path).unwrap();
let cfg: Config = serde_json::from_str(&content).unwrap();
Ok(cfg)
}
```
Return the code updated with doc comments. | pass→fail | 10,080 | 14,183 | +41% | 1 | 1 | 0% | 1,930 | 2,683 | +39% | 0 | 0 | — |