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
?
73%
Quality Avg
?
74%
Security Avg
?
74%
Reviews
?
130
Review Result ?
solutionbowl/crm-dashbaord · 2588ef0c
This merge introduces drag-and-drop kit dependencies and enhances the AdminRacePage with logic to calculate and display adjusted odds percentages, enabling more intuitive odds management. The use of React hooks and state appears consistent with functional patterns, contributing good quality. However, there is some minor code redundancy (e.g., double semicolon) and non-strict input validation which may lead to bugs or incorrect display, especially in the percentage-to-odd adjustment functions. The version upgrades to dependencies are standard and increase functionality. Security is moderate as no sensitive code or vulnerability patterns are introduced by these UI and state changes.
Quality
?
80%
Security
?
70%
Business Value
?
75%
Maintainability
?
75%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Double Semicolon
Where
src/modules/horse/pages/Race/AdminRacepage.tsx:141
Issue / Evidence
double semicolon
Suggested Fix
remove one semicolon to improve code cleanliness
Missing Validation
Where
src/modules/horse/pages/Race/AdminRacepage.tsx:139-140
Issue / Evidence
input validation
Suggested Fix
add validation or sanitize inputs in calculatePercentAdjustedOdd to handle edge cases and avoid invalid or negative odds
Duplicate Logic
Where
src/modules/horse/pages/Race/AdminRacepage.tsx:1161-1189
Issue / Evidence
code duplication
Suggested Fix
consider refactoring applyBackPct and applyLayPct to reduce duplication and improve maintainability
Input Elements
Where
src/modules/horse/pages/Race/AdminRacepage.tsx:1264-1315
Issue / Evidence
input elements
Suggested Fix
add explicit input type="text" or "number" and validate user input to prevent invalid data entry and reduce bug risk
Vague Description
Where
commit message
Issue / Evidence
vague description
Suggested Fix
write a more descriptive commit message explaining the functionality added or fixed for better traceability
Code Change Preview · package-lock.json
?
Removed / Before Commit
- diff --git a/package-lock.json b/package-lock.json - index d25dcf7..54199df 100644 - "name": "zynix-ts", - "version": "0.0.0", - "dependencies": { - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.0", - "@fortawesome/fontawesome-free": "^7.2.0", - "node": ">=6.9.0" - } - }, - "node_modules/@emotion/babel-plugin": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", - "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==", - "license": "MIT" - }, - "node_modules/d3-array": {
Added / After Commit
+ diff --git a/package-lock.json b/package-lock.json + index d25dcf7..54199df 100644 + "name": "zynix-ts", + "version": "0.0.0", + "dependencies": { + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/sortable": "^10.0.0", + "@dnd-kit/utilities": "^3.2.2", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.0", + "@fortawesome/fontawesome-free": "^7.2.0", + "node": ">=6.9.0" + } + }, + "node_modules/@dnd-kit/accessibility": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", + "integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==",
Removed / Before Commit
- diff --git a/package.json b/package.json - index 45ffee2..66163b8 100644 - "sass-min": "sass ./src/assets/scss/:./src/assets/css/ --style compressed" - }, - "dependencies": { - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.0", - "@fortawesome/fontawesome-free": "^7.2.0",
Added / After Commit
+ diff --git a/package.json b/package.json + index 45ffee2..66163b8 100644 + "sass-min": "sass ./src/assets/scss/:./src/assets/css/ --style compressed" + }, + "dependencies": { + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/sortable": "^10.0.0", + "@dnd-kit/utilities": "^3.2.2", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.0", + "@fortawesome/fontawesome-free": "^7.2.0",
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Race/AdminRacepage.tsx b/src/modules/horse/pages/Race/AdminRacepage.tsx - index 3ec68f0..f3c15a6 100644 - import { toast } from "react-toastify"; - import { useParams } from "react-router-dom"; - import Pageheader from "../../components/pageheader/pageheader"; - import { tenantServiceInstance as axiosInstance } from "../../../../services/api/axiosConfig"; - import useRaceOddsSocket from "../../hooks/useRaceOddsSocket"; - - - type GlobalState = { active: boolean; suspended: boolean; inactive: boolean }; - type StatusField = keyof GlobalState; - type OddsField = keyof Pick<OddsRow, "back_odd" | "lay_odd">; - - type UpdateOddsPayload = { - marketsData: Array<{ - return false; - }; -
Added / After Commit
+ diff --git a/src/modules/horse/pages/Race/AdminRacepage.tsx b/src/modules/horse/pages/Race/AdminRacepage.tsx + index 3ec68f0..f3c15a6 100644 + import { toast } from "react-toastify"; + import { useParams } from "react-router-dom"; + import Pageheader from "../../components/pageheader/pageheader"; + + import { tenantServiceInstance as axiosInstance } from "../../../../services/api/axiosConfig"; + import useRaceOddsSocket from "../../hooks/useRaceOddsSocket"; + + + type GlobalState = { active: boolean; suspended: boolean; inactive: boolean }; + type StatusField = keyof GlobalState; + + type UpdateOddsPayload = { + marketsData: Array<{ + return false; + }; +
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Race/RaceDetail.tsx b/src/modules/horse/pages/Race/RaceDetail.tsx - index a12abef..a40e2f2 100644 - }); - - toast.success(`Position saved as ${position}`); - // Refetch race details to ensure data is up to date - fetchRaceDetail(id); - } catch (error: any) { - setRunnerPositions((prev) => { - const updated = { ...prev }; - </Card> - </Col> - </Row> - - {/* Horse Runners Panel */} - <Row className="mb-4"> - <Col xl={12}> - <Card className="custom-card">
Added / After Commit
+ diff --git a/src/modules/horse/pages/Race/RaceDetail.tsx b/src/modules/horse/pages/Race/RaceDetail.tsx + index a12abef..a40e2f2 100644 + }); + + toast.success(`Position saved as ${position}`); + } catch (error: any) { + setRunnerPositions((prev) => { + const updated = { ...prev }; + </Card> + </Col> + </Row> + {/* Horse Runners Panel */} + <Row className="mb-4"> + <Col xl={12}> + <Card className="custom-card"> + {horse.status ? "Active" : "Inactive"} + </Badge> + </td>
Removed / Before Commit
- diff --git a/src/pages/Casino/CasinoCategory.tsx b/src/pages/Casino/CasinoCategory.tsx - index 605d1e6..f64cfae 100644 - import { Fragment, useState } from "react"; - import { Card, Col, Row, Button, Form, Modal } from "react-bootstrap"; - import Pageheader from "../../components/pageheader/pageheader"; - - const LS_KEY = "casino_categories"; - - </span> - </Card.Header> - <Card.Body className="p-0"> - <div className="table-responsive"> - <table className="table table-hover mb-0"> - <thead className="table-light"> - <tr> - <th style={{ fontWeight: "400" }}>Sr No.</th> - <th style={{ fontWeight: "400" }}>Name</th> - <th style={{ fontWeight: "400" }}>Position</th>
Added / After Commit
+ diff --git a/src/pages/Casino/CasinoCategory.tsx b/src/pages/Casino/CasinoCategory.tsx + index 605d1e6..f64cfae 100644 + import { Fragment, useState } from "react"; + import { Card, Col, Row, Button, Form, Modal } from "react-bootstrap"; + import Pageheader from "../../components/pageheader/pageheader"; + import DataTable from "react-data-table-component"; + + + const LS_KEY = "casino_categories"; + + </span> + </Card.Header> + <Card.Body className="p-0"> + <DataTable + columns={[ + { name: "Sr No.", selector: (_: Category, i?: number) => (i ?? 0) + 1, width: "80px" }, + { name: "Name", selector: (r: Category) => r.name, sortable: true, cell: (r: Category) => <span className="fw-medium">{r.name}</span> }, + { name: "Position", selector: (r: Category) => r.position, sortable: true },
Removed / Before Commit
- diff --git a/src/pages/Casino/LiveCasino.tsx b/src/pages/Casino/LiveCasino.tsx - index b3c44ad..9853089 100644 - const [show, setShow] = useState(false); - const [search, setSearch] = useState(""); - const [deleteId, setDeleteId] = useState<string | null>(null); - - const games = ["Poker", "Blackjack", "Baccarat"];
Added / After Commit
+ diff --git a/src/pages/Casino/LiveCasino.tsx b/src/pages/Casino/LiveCasino.tsx + index b3c44ad..9853089 100644 + const [show, setShow] = useState(false); + const [search, setSearch] = useState(""); + const [deleteId, setDeleteId] = useState<string | null>(null); + + + const games = ["Poker", "Blackjack", "Baccarat"];
Removed / Before Commit
- diff --git a/src/pages/Platforms/AdminMarketPage.tsx b/src/pages/Platforms/AdminMarketPage.tsx - index 0d37d7a..8d5dbcf 100644 - - type GlobalState = { active: boolean; suspended: boolean; inactive: boolean }; - type StatusField = keyof GlobalState; - type OddsField = keyof Pick<OddsRow, "back_odd" | "lay_odd">; - - type UpdateOddsPayload = { - marketsData: Array<{ - return false; - }; - - const calculatePercentAdjustedOdd = (baseOdd: number, percent: number) => { - const adjusted = (baseOdd * percent) / 100; - return Number(adjusted.toFixed(2)); - }; - - const getRunnerRowKey = (marketId: string, index: number, runner?: OddsRow["runner"]) =>
Added / After Commit
+ diff --git a/src/pages/Platforms/AdminMarketPage.tsx b/src/pages/Platforms/AdminMarketPage.tsx + index 0d37d7a..8d5dbcf 100644 + + type GlobalState = { active: boolean; suspended: boolean; inactive: boolean }; + type StatusField = keyof GlobalState; + + type UpdateOddsPayload = { + marketsData: Array<{ + return false; + }; + + const calculatePercentAdjustedOdd = (winnerOdd: number, pct: number): number => { + if (winnerOdd <= 0 || pct <= 0) return 0; + return Number(((winnerOdd * pct) / 100).toFixed(2)); + };; + + const getRunnerRowKey = (marketId: string, index: number, runner?: OddsRow["runner"]) => + runner?.runnerId
Removed / Before Commit
- diff --git a/src/services/api/casinoService.ts b/src/services/api/casinoService.ts - new file mode 100644 - index 0000000..e69de29
Added / After Commit
+ diff --git a/src/services/api/casinoService.ts b/src/services/api/casinoService.ts + new file mode 100644 + index 0000000..e69de29