Showing AI reviews for avriti
Project AI Score ?
63%
Quality Avg ?
68%
Security Avg ?
45%
Reviews ?
56

Review Result ?

jattin01/avriti · 87aba3cc
The commit adds a detailed checkout page with state management, form fields, and order placement functionality with saved addresses UI. It improves user experience by auto-filling user details and handles 'Buy Now' priority over Cart. However, the commit lacks error handling detail and secure storage/access for sensitive data. The commit message is minimal and unclear.
Quality ?
75%
Security ?
40%
Business Value ?
80%
Maintainability ?
75%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Vague Description
Where commit message
Issue / Evidence vague description
Suggested Fix provide a detailed descriptive message explaining the UI fixes to improve business value and review clarity
Empty Catch Blocks
Where app/checkout/page.tsx:33-43
Issue / Evidence empty catch blocks
Suggested Fix add error logging or user feedback to improve bug detection and troubleshooting
Missing Validation
Where app/checkout/page.tsx:44-73
Issue / Evidence localStorage usage without validation
Suggested Fix add validation and fallback logic to handle malformed data to reduce bug risk
Missing Validation
Where app/checkout/page.tsx:81-83
Issue / Evidence minimal form validation
Suggested Fix improve validation with proper error messages per field to enhance user experience and reduce bug risk
Missing Error Logging On Fetch Failure
Where app/checkout/page.tsx:88-107
Issue / Evidence missing error logging on fetch failure
Suggested Fix add console or monitoring logging for fetch errors to improve debugging
Token Obtained Via Gettoken But No Refresh...
Where app/checkout/page.tsx:88-107
Issue / Evidence token obtained via getToken but no refresh or expiration check
Suggested Fix implement token validation or refresh to enhance security
User Data From Localstorage Stored In Plai...
Where app/checkout/page.tsx:36-42
Issue / Evidence user data from localStorage stored in plain JS object
Suggested Fix consider encrypting or securing localStorage data to improve security
Saved Addresses Are Hard Coded
Where app/checkout/page.tsx:124-156
Issue / Evidence saved addresses are hard-coded
Suggested Fix implement dynamic loading or user-editable saved addresses to increase business value
Missing Labels Or Aria Attributes On Some...
Where app/checkout/page.tsx:250
Issue / Evidence missing labels or aria attributes on some inputs
Suggested Fix improve accessibility compliance to enhance quality
Inline Onclick Changes Window Location Dir...
Where app/cart/page.tsx:248-250
Issue / Evidence inline onClick changes window location directly
Suggested Fix consider using routing framework for navigation to improve maintainability and user experience
Code Change Preview · app/cart/page.tsx ?
Removed / Before Commit
- getLocalCart,
- updateLocalQty,
- removeFromLocalCart,
-   clearLocalCart,
- apiGetCart,
- apiUpdateQty,
- apiRemoveItem,
-   apiClearCart,
-   LocalCartItem,
- } from "@/lib/cart";
- 
- type CartItem = {
- <p className="text-[15px] text-[#7A7A7A]">₹{subtotal.toFixed(0)}</p>
- </div>
- <div className="mt-5 flex flex-col gap-2 md:mt-9">
-                   <Link href="/checkout" className="inline-flex min-h-11 items-center justify-center gap-2 rounded-[10px] border border-[var(--color-primary-300)] bg-white px-5 py-2.5 text-sm font-semibold text-[var(--color-primary-700)] transition hover:bg-[var(--color-primary-100)]/35">
- Proceed to Checkout
-                   </Link>
Added / After Commit
+ getLocalCart,
+ updateLocalQty,
+ removeFromLocalCart,
+ apiGetCart,
+ apiUpdateQty,
+ apiRemoveItem,
+ } from "@/lib/cart";
+ 
+ type CartItem = {
+ <p className="text-[15px] text-[#7A7A7A]">₹{subtotal.toFixed(0)}</p>
+ </div>
+ <div className="mt-5 flex flex-col gap-2 md:mt-9">
+                   <button onClick={() => { localStorage.removeItem("avriti_buy_now"); window.location.href = "/checkout"; }} className="inline-flex min-h-11 items-center justify-center gap-2 rounded-[10px] border border-[var(--color-primary-300)] bg-white px-5 py-2.5 text-sm font-semibold text-[var(--color-primary-700)] transition hover:bg-[var(--color-primary-100)]/35 cursor-pointer">
+ Proceed to Checkout
+                   </button>
+ <Link href="/shop" className="inline-flex min-h-11 items-center justify-center gap-2 rounded-[10px] border border-[var(--color-primary-300)] bg-[var(--color-primary-700)] px-5 py-2.5 text-sm font-semibold text-white transition hover:bg-[var(--color-primary-100)]/35 hover:text-[var(--color-primary-700)]">
+ Continue Shopping
+ </Link>
Removed / Before Commit
- import InnerBanner from "@/components/inner-banner";
- import { ProductCard } from "@/components/product-card";
- 
- const checkoutItems = [
-   {
-     name: "Avriti Shuddhi - Mopping Salt - 1kg",
-     quantity: 2,
-     price: 95,
-   },
-   {
-     name: "Drishti Tarot Cards - Pack of 78 cards",
-     quantity: 1,
-     price: 299,
-   },
- ];
- 
- const subtotal = checkoutItems.reduce((sum, item) => sum + item.price * item.quantity, 0);
- const tax = Math.round(subtotal * 0.05);
Added / After Commit
+ "use client";
+ 
+ import { useEffect, useState } from "react";
+ import InnerBanner from "@/components/inner-banner";
+ import { apiGetCart, getToken } from "@/lib/cart";
+ 
+ 
+ type CheckoutItem = {
+   product_id: number;
+   title: string;
+   attribute_name: string;
+   attribute_value: string;
+   quantity: number;
+ };
+ 
+ export default function CheckoutPage() {
+   const [items, setItems] = useState<CheckoutItem[]>([]);
+   const [loading, setLoading] = useState(true);
Removed / Before Commit
- } catch {}
- window.location.href = "/";
- } catch {
-       setError(" Please try again.");
- } finally {
- setLoading(false);
- }
Added / After Commit
+ } catch {}
+ window.location.href = "/";
+ } catch {
+       setError("Network error. Please try again.");
+ } finally {
+ setLoading(false);
+ }