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 · 3b141198
The commit introduces various user interface changes related to product details and checkout, including SKU handling and handling of 'howToUse' instructions. However, there are concerns around use of dangerouslySetInnerHTML which may introduce XSS risks. The commit message is vague and incomplete, reducing clarity and traceability. The changes moderately improve UI functionality and product display, but could be clearer and safer.
Quality
?
70%
Security
?
20%
Business Value
?
60%
Maintainability
?
65%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Vague And Incomplete
Where
commit message
Issue / Evidence
vague and incomplete
Suggested Fix
improve the commit message to clearly describe what 'complete frontend razorpay not complete' means and what parts were actually changed
Use Of Dangerouslysetinnerhtml Without San...
Where
components/ProductDetailSection.tsx:213
Issue / Evidence
use of dangerouslySetInnerHTML without sanitization
Suggested Fix
sanitize or validate HTML content before rendering to prevent XSS vulnerabilities
Optional Sku Field Introduction
Where
app/checkout/page.tsx:13
Issue / Evidence
optional sku field introduction
Suggested Fix
add validation or typesafety checks to ensure sku integrity
List Item Keys As Indices
Where
components/product-accordion.tsx:231
Issue / Evidence
list item keys as indices
Suggested Fix
use unique stable keys for list elements to avoid React key issues in rendering
State Setting Without Error Handling
Where
app/shop/[slug]/page.tsx:46
Issue / Evidence
state setting without error handling
Suggested Fix
add error handling or default states in case of missing product data
Code Change Preview · app/checkout/page.tsx
?
Removed / Before Commit
- attribute_name: string; - attribute_value: string; - variant_name?: string; - selling_price: number; - mrp: number; - quantity: number; - attribute_name: parsed.attribute_name, - attribute_value: parsed.attribute_value, - variant_name: parsed.variant_name, - selling_price: parsed.selling_price ?? 0, - mrp: parsed.mrp ?? 0, - quantity: parsed.quantity, - attribute_name: c.attribute_name, - attribute_value: String(c.attribute_value), - variant_name: c.variant_name ?? "", - selling_price: c.selling_price ?? 0, - mrp: c.mrp ?? 0, - quantity: c.quantity,
Added / After Commit
+ attribute_name: string; + attribute_value: string; + variant_name?: string; + sku?: string; + selling_price: number; + mrp: number; + quantity: number; + attribute_name: parsed.attribute_name, + attribute_value: parsed.attribute_value, + variant_name: parsed.variant_name, + sku: parsed.sku ?? "", + selling_price: parsed.selling_price ?? 0, + mrp: parsed.mrp ?? 0, + quantity: parsed.quantity, + attribute_name: c.attribute_name, + attribute_value: String(c.attribute_value), + variant_name: c.variant_name ?? "", + sku: c.sku ?? "",
Removed / Before Commit
- - <section className="mx-auto my-[50px] max-w-7xl px-4 sm:px-6 md:my-[80px] lg:px-8"> - <div className="overflow-hidden rounded-[8px] border border-[#E3DED6] bg-[#FBF9F5] shadow-[0_4px_18px_rgba(38,24,15,0.08)]"> - <div className="flex flex-col gap-2 bg-[var(--color-primary-700)] px-4 py-3 text-[13px] font-bold text-white sm:flex-row sm:items-center sm:justify-between sm:px-6"> - <p>Order ID: {order.order_number}</p> - <p>Order Date: {new Date(order.created_at).toLocaleString("en-IN")}</p> - </div>
Added / After Commit
+ + <section className="mx-auto my-[50px] max-w-7xl px-4 sm:px-6 md:my-[80px] lg:px-8"> + <div className="overflow-hidden rounded-[8px] border border-[#E3DED6] bg-[#FBF9F5] shadow-[0_4px_18px_rgba(38,24,15,0.08)]"> + <div className="flex flex-col gap-2 bg-[var(--color-primary-700)] px-4 py-3 text-[16px] font-bold text-white sm:flex-row sm:items-center sm:justify-between sm:px-6"> + <p>Order ID: {order.order_number}</p> + <p>Order Date: {new Date(order.created_at).toLocaleString("en-IN")}</p> + </div>
Removed / Before Commit
- - const [featuredProducts, setFeaturedProducts] = useState<FeaturedProduct[]>([]); - const [description, setDescription] = useState(""); - const [howToUse, setHowToUse] = useState(""); - const [bestFor, setBestFor] = useState<string[]>([]); - const [includes, setIncludes] = useState<string[]>([]); - - if (data.success && Array.isArray(data.data)) { - const currentProduct = data.data.find((p: any) => p.slug === slug); - setDescription(currentProduct?.description ?? ""); - setHowToUse(currentProduct?.how_to_use ?? ""); - setBestFor(currentProduct?.best_for ?? []); - setIncludes(currentProduct?.includes ?? []);
Added / After Commit
+ + const [featuredProducts, setFeaturedProducts] = useState<FeaturedProduct[]>([]); + const [description, setDescription] = useState(""); + const [howToUse, setHowToUse] = useState<string[]>([]); + const [bestFor, setBestFor] = useState<string[]>([]); + const [includes, setIncludes] = useState<string[]>([]); + + if (data.success && Array.isArray(data.data)) { + const currentProduct = data.data.find((p: any) => p.slug === slug); + setDescription(currentProduct?.description ?? ""); + setHowToUse(currentProduct?.how_to_use ?? []); + setBestFor(currentProduct?.best_for ?? []); + setIncludes(currentProduct?.includes ?? []);
Removed / Before Commit
- - type ProductAccordionProps = { - description?: string; - howToUse?: string; - bestFor?: string[]; - includes?: string[]; - }; - { - key: "how_to_use", - label: "How to Use", - content: howToUse ? ( - <div dangerouslySetInnerHTML={{ __html: howToUse }} /> - ) : ( - <span>Usage instructions not available.</span> - ),
Added / After Commit
+ + type ProductAccordionProps = { + description?: string; + howToUse?: string[]; + bestFor?: string[]; + includes?: string[]; + }; + { + key: "how_to_use", + label: "How to Use", + content: howToUse && howToUse.length > 0 ? ( + <ul style={{ paddingLeft: "18px", margin: 0, display: "flex", flexDirection: "column", gap: "6px" }}> + {howToUse.map((item, i) => <li key={i}>{item}</li>)} + </ul> + ) : ( + <span>Usage instructions not available.</span> + ),
Removed / Before Commit
- {/* Attribute Pills */} - {product.attributes && product.attributes.length > 0 && ( - <div className="mb-5 flex gap-2 items-center "> - <p className="text-xs font-semibold uppercase shrink-0 text-[#000]">Select {product.variant?.name ?? "Variant"} :</p> - - <div className="flex overflow-x-auto whitespace-nowrap gap-2 scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"> - {/* // Old: no out-of-stock strikethrough on variant pills */} - </div> - - {/* Description */} - <p className="text-[15px] leading-relaxed text-[#6b6060] mb-5 pb-5 border-b border-[#e5ddd5]"> - {product.short_description} - </p> - - {/* Quantity + Add to Cart */} - <div className="flex items-center gap-4 mb-4"> - attribute_name: selectedAttr.name, - attribute_value: selectedAttr.value,
Added / After Commit
+ {/* Attribute Pills */} + {product.attributes && product.attributes.length > 0 && ( + <div className="mb-5 flex gap-2 items-center "> + + {/* product details page select kg ,gm etc */} + {/* {product.variant?.name ?? "Variant"} */} + <p className="text-xs font-semibold uppercase shrink-0 text-[#000]">Select:</p> + + <div className="flex overflow-x-auto whitespace-nowrap gap-2 scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"> + {/* // Old: no out-of-stock strikethrough on variant pills */} + </div> + + {/* Description */} + <div + className="text-[15px] leading-relaxed text-[#6b6060] mb-5 pb-5 border-b border-[#e5ddd5]" + dangerouslySetInnerHTML={{ __html: product.short_description ?? "" }} + /> +