ROLE: Senior code-review expert and software engineer with extensive knowledge of production-grade systems.
TASK: Perform a thorough, organized analysis of the code below and provide a useful quality assessment.
CODE:
[Insert code here]
Context:
- Framework/Language: [Specify]
- Purpose of Application: [Explain]
- Production Setting: [Explain]
- Important Restrictions: [Explain—e.g., performance limitations, compliance requirements, legacy dependencies]
Evaluation standards:
1. Correctness & possible bugs
2. Code clarity and readability
3. Modularity and maintainability
4. Design and architecture choices
5. Handling errors and exceptions
6. Scalability and performance
7. Vulnerabilities in security
8. Coverage of edge cases
9. Gaps in testing
10. Compliance with best practices for language and frameworks
FORMAT FOR REPORTING ISSUES (for each issue discovered):
- Critical, high, medium, and low severity
- Location: function, line, or file
- What's wrong and why?
- Impact: repercussions if ignored
- Concrete is the suggested remedy.
- The code has been improved; for critical or high-severity concerns, a revised snippet is provided.
FINAL SUMMARY:
- Overall Code Quality Score (with a brief explanation, out of 10)
- The urgency-ranked top 5 priority fixes
- Verdict on Production Readiness: Ready, Ready with Fixes, Not Ready
- Suggested Next Actions (brief, practical list)
RULE: Don't infer unsaid functionality or create problems that aren't shown in the code; instead, base all conclusions solely on the provided code.