Smart Code Review & Complexity Analyzer is a backend-focused Spring Boot project that performs static analysis on Java source code to compute complexity metrics, maintainability scores, code smells, and quality bands. The system is designed with industry-grade architecture, clean separation of concerns, and persistence-first querying to reflect real backend engineering practices.
This project intentionally avoids UI-heavy or AI-driven shortcuts and focuses on core backend correctness, extensibility, and production readiness.
- Java source code parsing using AST
- Cyclomatic Complexity analysis (method & class level)
- Maintainability Index calculation
- Code Smell detection engine
- Quality Banding based on computed metrics
- Persistent storage of analysis runs (JPA)
- Fetch-only query APIs (no re-analysis on read)
- Global exception handling with stable error contracts
- Role-Based Access Control (RBAC)
- Clean DTO–Entity separation
- Language: Java
- Framework: Spring Boot
- Parsing: JavaParser (AST)
- Persistence: Spring Data JPA
- Database: H2 (dev), PostgreSQL (prod-ready)
- Security: Spring Security (RBAC)
- Build Tool: Maven
- Utilities: Lombok
The project follows a layered, domain-driven backend architecture:
- Controller Layer – Exposes REST APIs
- Service Layer – Orchestrates analysis and query flows
- Analysis Engine – Metrics, complexity, smells, quality
- Persistence Layer – JPA entities & repositories
- Query Layer – Fetch-only read models
- Exception Layer – Centralized error handling
Key architectural principles:
- No entity leakage to controllers
- Services throw domain exceptions, not HTTP responses
- Queries fetch persisted results only
- Stable API contracts
-
Java source file is uploaded
-
AST is generated from source code
-
Metrics are computed:
- Method count
- Cyclomatic complexity
- Maintainability score
-
Code smells are detected
-
Quality band is derived
-
Results are persisted as an analysis run
-
Subsequent requests fetch results from DB only
- Submit Java file for analysis
- Fetch analysis results by run ID
- Retrieve class-level metrics and smells
- Consistent error responses via global exception handler
Defined roles:
- USER – View own analysis runs
- REVIEWER – View all analysis runs (read-only)
- ADMIN – Full access (view, manage, delete)
RBAC is applied at the API level using Spring Security annotations.
- Centralized
@RestControllerAdvice - Custom domain exceptions
- Stable
ErrorResponsecontract - Proper HTTP status mapping
- Repository and service-level testing supported
- Dockerization planned for production-like deployment
- Database profiles for dev and prod environments
✔ Core analysis engine completed ✔ Persistence & query layer completed ✔ API contracts finalized ✔ RBAC implemented ⏳ Testing & Dockerization
This project demonstrates:
- Strong backend fundamentals
- Real-world architectural decisions
- Clean exception and persistence handling
It is intentionally designed to be defensible in technical interviews and aligned with industry backend expectations.
This project is for educational and portfolio purposes.