▸case-01 I'm preparing a pull request for our payment gateway integration module (`payment_service.py`). Could you audit all the code comments and docstrings in this file against the actual code logic? Please provide a report of your findings categorized by the severity of the documentation issues. | fail→pass | 2,165 | 2,237 | +3% | 1 | 1 | 0% | 451 | 877 | +94% | 0 | 0 | — |
▸case-02 We recently overhauled our user authentication service, but many inline comments still reference the old architecture. Please review the attached code snippet to evaluate the quality of its comments and list any problem areas grouped by priority or severity. | fail→fail | 3,878 | 1,791 | -54% | 1 | 1 | 0% | 689 | 760 | +10% | 0 | 0 | — |
▸case-03 Before we publish version 2.0 of our open-source data processing library, I want to ensure our public API comments are helpful and correct. Please inspect the code below for documentation flaws or low-quality comments, and group your findings by issue severity. | fail→fail | 4,107 | 2,550 | -38% | 1 | 1 | 0% | 815 | 935 | +15% | 0 | 0 | — |
▸case-04 Here is an uncommented Python function `def calculate_discount(price: float, tier: str) -> float:` that calculates customer discounts based on subscription tier. Please generate a complete Google-style docstring from scratch for this function. | pass→pass | 4,962 | 3,983 | -20% | 1 | 1 | 0% | 1,298 | 1,132 | -13% | 0 | 0 | — |
▸case-05 Review the following Python code for `process_order`: `def process_order(items): total = sum([i.price for i in items]); return total`. Refactor this function to improve performance and add error handling for empty item lists. | pass→fail | 5,812 | 7,978 | +37% | 1 | 1 | 0% | 1,400 | 2,245 | +60% | 0 | 0 | — |
▸case-06 We have a module `auth_validator.py` with `validate_token(token: str) -> bool`. Please write pytest unit tests covering valid tokens, expired tokens, and malformed inputs. | pass→pass | 9,801 | 7,905 | -19% | 1 | 1 | 0% | 2,586 | 2,076 | -20% | 0 | 0 | — |
▸case-07 Analyze the inline comment in `calculate_tax` against the code implementation: `def calculate_tax(amount: float, rate: float = 0.05) -> float:
# Calculates tax by multiplying amount by rate percentage (e.g. rate=5 means 5%)
return amount * rate`. Group findings by severity. | fail→pass | 7,149 | 4,180 | -42% | 1 | 1 | 0% | 1,756 | 1,381 | -21% | 0 | 0 | — |
▸case-08 Analyze the inline comment in `connect_db` against the code implementation: `def connect_db(connection_string: str, timeout: int = 30) -> Connection:
# Connects to database. Formerly accepted use_ssl parameter.
return Connection(connection_string, timeout=timeout)`. Group findings by issue severity. | pass→pass | 8,658 | 4,141 | -52% | 1 | 1 | 0% | 1,823 | 1,257 | -31% | 0 | 0 | — |
▸case-09 Evaluate the inline comment in `counter.py`: `# Increment i by 1
i = i + 1`. Group findings by documentation severity. | pass→pass | 6,239 | 3,188 | -49% | 1 | 1 | 0% | 1,181 | 1,083 | -8% | 0 | 0 | — |
▸case-10 Inspect the technical debt comments in `process_refund`: `def process_refund(transaction_id: str):
# TODO: Implement retry logic for network timeouts during refund processing
# HACK: Hardcoded fix for bug 402
return api.post(f"/refunds/{transaction_id}")`. Categorize findings by issue severity. | fail→pass | 9,831 | 6,145 | -37% | 1 | 1 | 0% | 2,068 | 1,676 | -19% | 0 | 0 | — |
▸case-11 Audit the comment for `purge_inactive_users`: `def purge_inactive_users(days: int):
# Purges inactive users
db.execute("DELETE FROM users WHERE last_login < NOW() - INTERVAL %s DAY", (days,))
cache.flush_all()`. Note that flushing global cache is an unmentioned side effect. Group findings by severity. | pass→pass | 19,353 | 9,862 | -49% | 1 | 1 | 0% | 1,834 | 1,092 | -40% | 0 | 0 | — |
▸case-12 Review the public docstring for `parse_csv_header`: `def parse_csv_header(header_line: str) -> list[str]:
"""Parses a CSV header string."""
if not header_line:
raise ValueError("Header cannot be empty")
return header_line.strip().split(",")`. Group findings by severity. | fail→pass | 10,008 | 4,895 | -51% | 1 | 1 | 0% | 2,113 | 1,421 | -33% | 0 | 0 | — |
▸case-13 Analyze the comment in `update_user_balance`: `def update_user_balance(user_id: int, delta: float):
# As of March 2022, line 45 handles the primary database lock
db.lock_row(user_id)
db.update_balance(user_id, delta)`. Group findings by severity. | fail→fail | 13,787 | 12,831 | -7% | 1 | 1 | 0% | 1,527 | 1,446 | -5% | 0 | 0 | — |
▸case-14 Inspect the comment in `is_admin`: `def is_admin(user: User) -> bool:
# Returns True if user is a guest, False if user is admin or superuser
return user.role in ("admin", "superuser")`. Categorize findings by severity. | fail→pass | 6,686 | 2,904 | -57% | 1 | 1 | 0% | 1,499 | 993 | -34% | 0 | 0 | — |
▸case-15 Review the docstring in `send_email_notification`: `def send_email_notification(recipient: str, message: str):
"""Guarantees immediate zero-latency delivery to any mail server worldwide with automatic retry."""
smtp_client.send(recipient, message)`. Group audit findings by severity. | pass→pass | 7,221 | 5,252 | -27% | 1 | 1 | 0% | 1,703 | 1,536 | -10% | 0 | 0 | — |
▸case-16 Audit the comment in `render_template`: `def render_template(template_name: str, context: dict) -> str:
# Uses Jinja2 v1.2 autoescape context syntax from 2015 release
return env.get_template(template_name).render(context)`. Group findings by issue severity. | fail→pass | 9,521 | 4,920 | -48% | 1 | 1 | 0% | 2,137 | 1,462 | -32% | 0 | 0 | — |
▸case-17 Perform a comment audit on `apply_promo_code`: `def apply_promo_code(user_id: str, promo_code: str, override_expiration: bool = False, max_discount: float = None):
"""Applies promo code to user account."""
pass`. Group findings by documentation severity. | fail→pass | 9,144 | 4,873 | -47% | 1 | 1 | 0% | 2,048 | 1,446 | -29% | 0 | 0 | — |
▸case-18 Evaluate the comment quality in `http_response.py`: `# Set status code to 200
status_code = 200`. Output findings categorized by issue severity. | fail→pass | 6,461 | 3,337 | -48% | 1 | 1 | 0% | 1,384 | 1,082 | -22% | 0 | 0 | — |
▸case-19 In `calculate_shipping_cost`: `def calculate_shipping_cost(weight: float, destination: str) -> float:
# Called by compute_freight_total() during checkout pipeline
return weight * 2.5`. `compute_freight_total()` was renamed to `finalize_shipping()` last month. Group audit findings by severity. | fail→pass | 7,583 | 3,894 | -49% | 1 | 1 | 0% | 1,672 | 1,255 | -25% | 0 | 0 | — |
▸case-20 Audit the comment in `sanitize_filename`: `def sanitize_filename(name: str) -> str:
# Safely handles None or empty string input by returning empty string
return name.replace("/", "_")`. Categorize findings by issue severity. | fail→pass | 8,276 | 5,812 | -30% | 1 | 1 | 0% | 1,923 | 1,598 | -17% | 0 | 0 | — |
▸case-21 Audit the comment in `encrypt_payload`: `def encrypt_payload(data: bytes) -> bytes:
# FIXME: AES-CBC mode is vulnerable to padding oracle attacks; migrate to AES-GCM
return cipher.encrypt(data)`. Group findings by documentation severity. | fail→fail | 10,492 | 6,585 | -37% | 1 | 1 | 0% | 2,200 | 1,637 | -26% | 0 | 0 | — |
▸case-22 Audit the comment in `mask_flags`: `def mask_flags(val: int) -> int:
# Masks flags
return (val & 0x7F) ^ ((val >> 3) & 0x1F)`. Group findings by documentation severity. | fail→pass | 9,764 | 5,177 | -47% | 1 | 1 | 0% | 2,224 | 1,511 | -32% | 0 | 0 | — |