AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
63%
Quality Avg
?
68%
Security Avg
?
45%
Reviews
?
56
Review Result ?
jattin01/avriti · 3db65a43
This commit adds variant_name fields across multiple files and enhances attribute value formatting and price calculation on cart and checkout pages. The changes improve data completeness and user interface clarity, reducing potential bugs related to missing variant info and inconsistent value formatting.
Quality
?
80%
Security
?
85%
Business Value
?
75%
Maintainability
?
78%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Numeric Conversion Could Fail For Non Nume...
Where
app/cart/page.tsx:146
Issue / Evidence
numeric conversion could fail for non-numeric attribute_value
Suggested Fix
add validation or error handling to avoid NaN results
Number.isfinite Might Not Catch All Invali...
Where
app/cart/page.tsx:147
Issue / Evidence
Number.isFinite might not catch all invalid inputs
Suggested Fix
consider more robust checking
Using Empty String Fallback For Variant Na...
Where
app/cart/page.tsx:55
Issue / Evidence
using empty string fallback for variant_name might mask missing data
Suggested Fix
consider null or explicit indicator
Fallback To Attribute Value As Price Assum...
Where
app/checkout/page.tsx:82
Issue / Evidence
fallback to attribute_value as price assumed to be numeric
Suggested Fix
sanitize input and handle non-numeric gracefully
Payload Mapping Omits Variant Name, But Co...
Where
lib/cart.ts:144
Issue / Evidence
payload mapping omits variant_name, but code adds variant_name in other places
Suggested Fix
ensure variant_name is included to maintain consistency
Message Is Generic And Uninformative
Where
commit message
Issue / Evidence
message is generic and uninformative
Suggested Fix
improve commit message to describe the bug fixed and impact
Code Change Preview · app/cart/page.tsx
?
Removed / Before Commit
- thumbnail: string; - attribute_name: string; - attribute_value: string; - selling_price: number; - mrp: number; - quantity: number; - thumbnail: d.thumbnail ?? "/product2.jpeg", - attribute_name: d.attribute_name ?? "", - attribute_value: d.attribute_value ?? "", - selling_price: d.selling_price ?? 0, - mrp: d.mrp ?? 0, - quantity: d.quantity, - thumbnail: c.thumbnail, - attribute_name: c.attribute_name, - attribute_value: c.attribute_value, - selling_price: c.selling_price, - mrp: c.mrp, - quantity: c.quantity,
Added / After Commit
+ thumbnail: string; + attribute_name: string; + attribute_value: string; + variant_name?: string; + selling_price: number; + mrp: number; + quantity: number; + thumbnail: d.thumbnail ?? "/product2.jpeg", + attribute_name: d.attribute_name ?? "", + attribute_value: d.attribute_value ?? "", + variant_name: d.variant_name ?? "", + selling_price: d.selling_price ?? 0, + mrp: d.mrp ?? 0, + quantity: d.quantity, + thumbnail: c.thumbnail, + attribute_name: c.attribute_name, + attribute_value: c.attribute_value, + variant_name: c.variant_name,
Removed / Before Commit
- title: string; - attribute_name: string; - attribute_value: string; - quantity: number; - }; - - title: parsed.title, - attribute_name: parsed.attribute_name, - attribute_value: parsed.attribute_value, - quantity: parsed.quantity, - }]); - } else { - title: c.title, - attribute_name: c.attribute_name, - attribute_value: String(c.attribute_value), - quantity: c.quantity, - })) - );
Added / After Commit
+ title: string; + attribute_name: string; + attribute_value: string; + selling_price: number; + mrp: number; + quantity: number; + }; + + title: parsed.title, + attribute_name: parsed.attribute_name, + attribute_value: parsed.attribute_value, + selling_price: parsed.selling_price ?? 0, + mrp: parsed.mrp ?? 0, + quantity: parsed.quantity, + }]); + } else { + title: c.title, + attribute_name: c.attribute_name,
Removed / Before Commit
- thumbnail: imageUrl, - attribute_name: selectedAttr.name, - attribute_value: selectedAttr.value, - selling_price: selectedAttr.selling_price, - mrp: selectedAttr.mrp, - quantity, - thumbnail: product.thumbnail?.[0] ? `${apiUrl}/${product.thumbnail[0]}` : "/product2.jpeg", - attribute_name: selectedAttr.name, - attribute_value: selectedAttr.value, - selling_price: selectedAttr.selling_price, - mrp: selectedAttr.mrp, - quantity,
Added / After Commit
+ thumbnail: imageUrl, + attribute_name: selectedAttr.name, + attribute_value: selectedAttr.value, + variant_name: product.variant?.name, + selling_price: selectedAttr.selling_price, + mrp: selectedAttr.mrp, + quantity, + thumbnail: product.thumbnail?.[0] ? `${apiUrl}/${product.thumbnail[0]}` : "/product2.jpeg", + attribute_name: selectedAttr.name, + attribute_value: selectedAttr.value, + variant_name: product.variant?.name, + selling_price: selectedAttr.selling_price, + mrp: selectedAttr.mrp, + quantity,
Removed / Before Commit
- thumbnail: string; - attribute_name: string; - attribute_value: string; - selling_price: number; - mrp: number; - quantity: number; - if (!token) return; - const items = getLocalCart(); - if (!items.length) return; - await fetch(`${API}/api/customer/cart/merge`, { - method: "POST", - headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` }, - body: JSON.stringify({ items }), - }); - clearLocalCart(); - }
Added / After Commit
+ thumbnail: string; + attribute_name: string; + attribute_value: string; + variant_name?: string; + selling_price: number; + mrp: number; + quantity: number; + if (!token) return; + const items = getLocalCart(); + if (!items.length) return; + const payload = items.map((c) => ({ + product_id: c.product_id, + attribute_name: c.attribute_name, + attribute_value: c.attribute_value, + quantity: c.quantity, + })); + await fetch(`${API}/api/customer/cart/merge`, { + method: "POST",