Reviews and improves **names** in code — variables, functions, classes, modules, parameters — for clarity, intent, and consistency with language/team conventions. Triggers when asked to review names, rename things, improve code readability, clean up confusing code, or when examining code with generic/vague names like "data", "info", "manager", "temp", "util". Does NOT trigger for general code review unrelated to naming, architecture design, debugging, or performance optimization. Identifies naming anti-patterns (generic names, misleading names, type-encoding, abbreviations), suggests role-based names that reveal intent, checks consistency with project/domain vocabulary, and flags misalignment with language culture.
91
90%
Does it follow best practices?
Impact
94%
1.05xAverage score across 5 eval scenarios
Passed
No known issues
A payments team inherited a small Python module that works, but several reviewers find it hard to discuss because the identifiers do not reveal the business concepts. They want a naming-focused review and a proposed cleaned-up version that preserves behavior.
Please review the snippet, explain which names are hurting readability, and provide a revised version with better identifiers. Keep the focus on names and rename safety rather than changing the algorithm.
Produce naming_review.md with a table of old names, proposed names, and rationale. Produce checkout_clean.py with the same logic using your proposed names. Include a short final section describing how you would safely apply these renames in a real codebase.
=============== FILE: checkout.py ===============
class Bad(Exception):
pass
MAX = 100
def process(d, flag=False):
tmp = []
for x in d:
str = x.get('status')
if flag and str != 'paid':
continue
val = x.get('amt', 0) * x.get('qty', 0)
if val > MAX:
tmp.append({'id': x.get('id'), 'val': val})
return tmp