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

Review Result ?

jattin01/avriti · 0a78979e
This commit adds dynamic tax calculation and display on cart and checkout pages, and loads services on the contact page. It improves business value by showing accurate tax info and available services. However, error handling and API usage could be improved. The commit message is vague and there is minor inconsistent API environment variable usage. Some security exposure risk exists since API URLs are built client-side without authentication or error feedback. Minor UI improvements and validation could enhance quality and reduce bug risk.
Quality ?
75%
Security ?
25%
Business Value ?
70%
Maintainability ?
80%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Unclear And Typo In Message
Where commit message
Issue / Evidence unclear and typo in message
Suggested Fix write a clearer, properly spelled commit message describing changes
Api Environment Variable Usage Inconsisten...
Where app/checkout/page.tsx:322
Issue / Evidence API environment variable usage inconsistent (uses API not process.env.NEXT_PUBLIC_API_URL)
Suggested Fix unify environment variable usage across files
Catch Block Does Not Log Error
Where app/cart/page.tsx:190
Issue / Evidence catch block does not log error
Suggested Fix add logging or error feedback for debugging
Catch Block Does Not Log Error
Where app/checkout/page.tsx:332
Issue / Evidence catch block does not log error
Suggested Fix add logging or error feedback for debugging
Catch Block Does Not Log Error
Where app/contact/page.tsx:162
Issue / Evidence catch block does not log error
Suggested Fix add logging or error feedback for debugging
Missing Validation
Where app/contact/page.tsx:319
Issue / Evidence phone input maxLength only, no format validation
Suggested Fix add phone number validation to improve input quality and reduce bugs
Missing Validation
Where app/cart/page.tsx:180
Issue / Evidence fetch call lacks error/status validation beyond success flag
Suggested Fix add HTTP status checks and handle failures explicitly
Missing Validation
Where app/checkout/page.tsx:321
Issue / Evidence fetch call lacks error/status validation beyond success flag
Suggested Fix add HTTP status checks and handle failures explicitly
Taxbreakup Key Uses Potentially Non Unique...
Where app/cart/page.tsx:314
Issue / Evidence taxBreakup key uses potentially non-unique name
Suggested Fix verify uniqueness or use a more reliable key
Taxbreakup Key Uses Potentially Non Unique...
Where app/checkout/page.tsx:740
Issue / Evidence taxBreakup key uses potentially non-unique name
Suggested Fix verify uniqueness or use a more reliable key
Code Change Preview · app/cart/page.tsx ?
Removed / Before Commit
- const [loggedIn, setLoggedIn] = useState(false);
- 
- const [featuredProducts, setFeaturedProducts] = useState<any[]>([]);
- 
- const loadCart = useCallback(async () => {
- setLoading(true);
- 0
- );
- 
- const goToCheckout = () => {
- localStorage.removeItem("avriti_buy_now");
- window.location.href = isLoggedIn()
- <p className="text-[15px] text-black">Subtotal</p>
- <p className="text-[15px] text-[#7A7A7A]">₹{subtotal.toFixed(0)}</p>
- </div>
-                 <div className="mt-2 flex items-center justify-between gap-2">
-                   <p className="text-[15px] text-black">Tax</p>
-                   <p className="text-[15px] text-[#7A7A7A]">₹0</p>
Added / After Commit
+ const [loggedIn, setLoggedIn] = useState(false);
+ 
+ const [featuredProducts, setFeaturedProducts] = useState<any[]>([]);
+   const [taxBreakup, setTaxBreakup] = useState<{ name: string; rate_percent: number; amount: number }[]>([]);
+   const [taxAmount, setTaxAmount] = useState(0);
+ 
+ const loadCart = useCallback(async () => {
+ setLoading(true);
+ 0
+ );
+ 
+   useEffect(() => {
+     if (subtotal <= 0) {
+       setTaxBreakup([]);
+       setTaxAmount(0);
+       return;
+     }
+ 
Removed / Before Commit
- const [placing, setPlacing] = useState(false);
- const [error, setError] = useState("");
- 
- // ── load Razorpay SDK ───────────────────────────────────────
- useEffect(() => {
- const script = document.createElement("script");
- return [value, item.variant_name].filter(Boolean).join(" ");
- };
- const subtotal = items.reduce((sum, item) => sum + getPrice(item) * item.quantity, 0);
-   const tax = Math.round(subtotal * 0.05);
- const shipping = 0;
- const total = subtotal + tax + shipping;
- 
- const isValidEmail = (email: string) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
- 
- // ── shared order payload ────────────────────────────────────
- <div className="flex items-center justify-between">
- <span>Subtotal</span><span>₹{subtotal}</span>
Added / After Commit
+ const [placing, setPlacing] = useState(false);
+ const [error, setError] = useState("");
+ 
+   // tax
+   const [taxBreakup, setTaxBreakup] = useState<{ name: string; rate_percent: number; amount: number }[]>([]);
+   const [taxAmount, setTaxAmount] = useState(0);
+ 
+ // ── load Razorpay SDK ───────────────────────────────────────
+ useEffect(() => {
+ const script = document.createElement("script");
+ return [value, item.variant_name].filter(Boolean).join(" ");
+ };
+ const subtotal = items.reduce((sum, item) => sum + getPrice(item) * item.quantity, 0);
+   const tax = taxAmount;
+ const shipping = 0;
+ const total = subtotal + tax + shipping;
+ 
+   useEffect(() => {
Removed / Before Commit
- 
- "use client";
- 
- import { useState } from "react";
- import { Mail, MapPin, MessageCircle, Phone } from "lucide-react";
- import { Badge } from "@/components/ui/badge";
- import { Button } from "@/components/ui/button";
- name: '',
- email: '',
- phone: '',
- message: '',
- });
- 
- const [errors, setErrors] = useState<Record<string, string>>({});
- const [success, setSuccess] = useState('');
- const [loading, setLoading] = useState(false);
- 
- const validate = () => {
Added / After Commit
+ 
+ "use client";
+ 
+ import { useEffect, useState } from "react";
+ import { Mail, MapPin, MessageCircle, Phone } from "lucide-react";
+ import { Badge } from "@/components/ui/badge";
+ import { Button } from "@/components/ui/button";
+ name: '',
+ email: '',
+ phone: '',
+     service_type: '',
+ message: '',
+ });
+ 
+ const [errors, setErrors] = useState<Record<string, string>>({});
+ const [success, setSuccess] = useState('');
+ const [loading, setLoading] = useState(false);
+   const [services, setServices] = useState<string[]>([]);
Removed / Before Commit
- html {
- scroll-behavior: smooth;
- }
- .withlist li:before {
- content: '';
- position: absolute;
- background: var(--color-primary-700);
- border-radius: 50%;
- left: 0;
- top: 9px;
- }
- ::selection {
- background: var(--color-primary-100);
- color: var(--color-primary-700);
Added / After Commit
+ html {
+ scroll-behavior: smooth;
+ }
+ /* .withlist li:before {
+ content: '';
+ position: absolute;
+ background: var(--color-primary-700);
+ border-radius: 50%;
+ left: 0;
+ top: 9px;
+ } */
+ ::selection {
+ background: var(--color-primary-100);
+ color: var(--color-primary-700);
Removed / Before Commit
- return (
- <div className="bg-white">
- <PdfBrowserFrame label="Website Home">
-         <div className="md:pt-[50px] pt-[20px] relative grid min-h-[650px] overflow-hidden lg:grid-cols-2 gap-4 md:gap-12 ">
- 
- <div className="relative z-10 flex flex-col justify-center">
- <p className="font-semibold leading-[0.98] text-[#e0e0e0] text-[40px] md:text-[50px] lg:text-[60px]">
- {home?.sc1heading ?? (
- <>Come Home<br />to Yourself</>
- )}
- </p>
-             <h1 className="mt-6 max-w-xl text-[14px] md:text-[15px] font-semibold leading-snug text-[var(--color-primary-700)]">
- Nobody has to know you're here. This is just for you.
- </h1>
- 
- <Button className="uppercase pl-[10px] pr-[0px] rounded-[10px] border-[1px]" variant="secondary">Book a Consultation <span className="buttonArrow ml-[15px]"></span></Button>
- 
- </Link>
Added / After Commit
+ return (
+ <div className="bg-white">
+ <PdfBrowserFrame label="Website Home">
+         <div className="md:pt-[50px] pt-[20px] relative grid min-h-[650px] overflow-hidden lg:grid-cols-2 gap-10 md:gap-12 ">
+ 
+ <div className="relative z-10 flex flex-col justify-center">
+              <div className="bg-[#0b3dba] text-center px-[18px] py-[6px] rounded-full max-w-[200px] mb-[20px]">
+                {/*  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" fill="none" stroke="#0b3dba" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+                   <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
+                   <circle cx="9" cy="7" r="4"/>
+                   <path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
+                   <path d="M16 3.13a4 4 0 0 1 0 7.75"/>
+                 </svg>*/}
+                 <h3 className="text-[14px] text-[#fff]  flex items-center justify-center gap-1"><span>✦</span><span className="font-bold md:text-[18px] "> 1100</span><span className=" "> Customers  Served</span></h3>
+               </div>
+ <p className="font-semibold leading-[0.98] text-[#e0e0e0] text-[40px] md:text-[50px] lg:text-[60px]">
+ {home?.sc1heading ?? (
+ <>Come Home<br />to Yourself</>
Removed / Before Commit
- </Link>
- </div>
- ) : (
-           <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
- {items.map((item) => (
- <div key={item.id} className="bg-[#F7F7F7] rounded-[20px] p-[20px] overflow-hidden">
-                 <div className="mt-1 mb-[10px] flex gap-2 items-center justify-between">
- <Link href={`/shop/${item.slug}`} className="text-sm font-normal leading-5 text-[#777777]">
- {item.title}
- {formatAttributeLabel(item) ? ` - ${formatAttributeLabel(item)}` : ""}
- </div>
- );
- }
Added / After Commit
+ </Link>
+ </div>
+ ) : (
+           <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
+ {items.map((item) => (
+ <div key={item.id} className="bg-[#F7F7F7] rounded-[20px] p-[20px] overflow-hidden">
+                 <div className="mt-1 mb-[10px] flex gap-2 items-start justify-between">
+ <Link href={`/shop/${item.slug}`} className="text-sm font-normal leading-5 text-[#777777]">
+ {item.title}
+ {formatAttributeLabel(item) ? ` - ${formatAttributeLabel(item)}` : ""}
+ </div>
+ );
+ }
+ 
+ 
+ 
+ 
+