Showing AI reviews for crm-dashbaord
Project AI Score ?
73%
Quality Avg ?
74%
Security Avg ?
74%
Reviews ?
130

Review Result ?

solutionbowl/crm-dashbaord · dd446354
The commit adds UI elements and utility functions to format and refresh odds data, improving user interaction and display precision. The code is straightforward with minimal security concerns. However, there is duplicated code for formatValue in two separate files, inconsistent styling approach (inline styles vs CSS classes), and an extremely large margin-left value (1000) that might cause UI issues on smaller screens. The commit message is minimal and not descriptive.
Quality ?
70%
Security ?
90%
Business Value ?
60%
Maintainability ?
70%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Issue
Where commit message
Issue / Evidence issue
Suggested Fix provide a more descriptive commit message that explains the purpose and scope of the changes for improved business value and maintainability
Duplicate Logic
Where src/modules/horse/pages/Race/stats.tsx:163-167
Issue / Evidence code duplication
Suggested Fix consolidate or reuse formatValue function instead of duplicating in multiple files to improve maintainability and reduce bug risk
Duplicate Logic
Where src/pages/Races/stats.tsx:183-187
Issue / Evidence code duplication
Suggested Fix same as above, avoid duplication of formatValue function
Styling Issue
Where src/modules/horse/pages/Race/stats.tsx:309
Issue / Evidence styling issue
Suggested Fix avoid using fixed large marginLeft (1000) as it reduces responsiveness; use relative or flex box styling instead
Styling Issue
Where src/pages/Races/stats.tsx:384
Issue / Evidence styling issue
Suggested Fix avoid inline styles; use CSS classes consistently to improve maintainability and visual consistency
Code Change Preview · src/modules/horse/pages/Race/stats.tsx ?
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Race/stats.tsx b/src/modules/horse/pages/Race/stats.tsx
- index 6d50e06..2a5b056 100644
- odds: Array.isArray(market?.odds) ? market.odds.map(normalizeOddsRow) : [],
- });
- 
- const formatValue = (value: number | null | undefined) => (value === null || value === undefined ? "-" : `${value}`);
- const multiPlaceMarkets = ["2PLACES", "3PLACES", "4PLACES"];
- 
- const Stats: React.FC = () => {
- <span><i className="ri-checkbox-blank-circle-fill me-1" style={{ color: "#71de7e" }} />Static Volume</span>
- </div> */}
- <div className="mt-3">
-                 <div style={{ color: "#6b7280", fontSize: 12, marginBottom: 10 }}>Markets</div>
- <div
- className="d-flex gap-3 pb-2"
- style={{ overflowX: "auto", overflowY: "hidden" }}
- </div>
- </div>
Added / After Commit
+ diff --git a/src/modules/horse/pages/Race/stats.tsx b/src/modules/horse/pages/Race/stats.tsx
+ index 6d50e06..2a5b056 100644
+ odds: Array.isArray(market?.odds) ? market.odds.map(normalizeOddsRow) : [],
+ });
+ 
+ // const formatValue = (value: number | null | undefined) => (value === null || value === undefined ? "-" : `${value}`);
+ 
+ const formatValue = (value: number | null | undefined) =>
+   value === null || value === undefined
+     ? "-"
+     : Number(value).toFixed(2);
+ 
+ const multiPlaceMarkets = ["2PLACES", "3PLACES", "4PLACES"];
+ 
+ const Stats: React.FC = () => {
+ <span><i className="ri-checkbox-blank-circle-fill me-1" style={{ color: "#71de7e" }} />Static Volume</span>
+ </div> */}
+ <div className="mt-3">
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Report/AgentReport.tsx b/src/modules/horse/pages/Report/AgentReport.tsx
- index e05b74b..78b3754 100644
- 
- return (
- <Fragment>
-       <Pageheader title="Agent Reports" currentpage="Reports" activepage="Agent Reports" />
- <Row>
- <Col xl={12}>
- <Card className="custom-card">
Added / After Commit
+ diff --git a/src/modules/horse/pages/Report/AgentReport.tsx b/src/modules/horse/pages/Report/AgentReport.tsx
+ index e05b74b..78b3754 100644
+ 
+ return (
+ <Fragment>
+       <Pageheader title="Agent Reports" currentpage="Agents" activepage="Agent Reports" />
+ <Row>
+ <Col xl={12}>
+ <Card className="custom-card">
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Report/AllReport.tsx b/src/modules/horse/pages/Report/AllReport.tsx
- index 36db138..11d50cb 100644
- };
- return (
- <Fragment>
-       <Pageheader title="All Reports" currentpage="Reports" activepage="All Reports" />
- <Row>
- <Col xl={12}>
- <Card className="custom-card">
Added / After Commit
+ diff --git a/src/modules/horse/pages/Report/AllReport.tsx b/src/modules/horse/pages/Report/AllReport.tsx
+ index 36db138..11d50cb 100644
+ };
+ return (
+ <Fragment>
+       <Pageheader title="Market Reports" currentpage="Market" activepage="All Reports" />
+ <Row>
+ <Col xl={12}>
+ <Card className="custom-card">
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Report/BetButtonMarket.tsx b/src/modules/horse/pages/Report/BetButtonMarket.tsx
- index 25f0acb..5715c12 100644
- <th>Stake</th>
- <th>Status</th>
- <th>User Win/Loss</th>
-                           <th> Agent Win/Loss</th>
- <th>IP Address</th>
- </tr>
- </thead>
- </div>
- 
- {/* Pagination */}
-                   {betsData.pagination && betsData.pagination.totalPages > 1 && (
- <div className="d-flex justify-content-between align-items-center mt-3">
- <div>
- Showing page {betsData.pagination.page} of {betsData.pagination.totalPages}
Added / After Commit
+ diff --git a/src/modules/horse/pages/Report/BetButtonMarket.tsx b/src/modules/horse/pages/Report/BetButtonMarket.tsx
+ index 25f0acb..5715c12 100644
+ <th>Stake</th>
+ <th>Status</th>
+ <th>User Win/Loss</th>
+                           <th>Agent Win/Loss</th>
+ <th>IP Address</th>
+ </tr>
+ </thead>
+ </div>
+ 
+ {/* Pagination */}
+                   {betsData.pagination && betsData.pagination.totalPages >= 1 && (
+ <div className="d-flex justify-content-between align-items-center mt-3">
+ <div>
+ Showing page {betsData.pagination.page} of {betsData.pagination.totalPages}
Removed / Before Commit
- diff --git a/src/modules/horse/utils/odds.tsx b/src/modules/horse/utils/odds.tsx
- index c2a155c..3f60ccf 100644
- export const adjustOdd = (value: number | null | undefined) => {
- if (value === null || value === undefined) return value;
-   return value + 1;
- };
- \ No newline at end of file
Added / After Commit
+ diff --git a/src/modules/horse/utils/odds.tsx b/src/modules/horse/utils/odds.tsx
+ index c2a155c..3f60ccf 100644
+ export const adjustOdd = (value: number | null | undefined) => {
+ if (value === null || value === undefined) return value;
+   return Number((value + 1).toFixed(2));
+ };
+ \ No newline at end of file
Removed / Before Commit
- diff --git a/src/pages/Races/stats.tsx b/src/pages/Races/stats.tsx
- index 637c606..8540f94 100644
- import { useParams } from "react-router-dom";
- import { toast } from "react-toastify";
- import Pageheader from "../../components/pageheader/pageheader";
- import { authService } from "../../services/api/authService";
- import { tenantServiceInstance as axiosInstance } from "../../services/api/axiosConfig";
- import useRaceOddsSocket from "../../modules/horse/hooks/useRaceOddsSocket";
- odds: Array.isArray(market?.odds) ? market.odds.map(normalizeOddsRow) : [],
- });
- 
- const formatValue = (value: number | null | undefined) => (value === null || value === undefined ? "-" : `${value}`);
- const formatExposure = (value: number) => (value > 0 ? `+${value}` : `${value}`);
- const formatTextValue = (value: string | number | null | undefined) =>
- value === null || value === undefined || value === "" ? "-" : String(value);
- <span><i className="ri-checkbox-blank-circle-fill me-1 stats-legend-icon stats-legend-icon-static" />Static Volume</span>
- </div> */}
- <div className="mt-3">
Added / After Commit
+ diff --git a/src/pages/Races/stats.tsx b/src/pages/Races/stats.tsx
+ index 637c606..8540f94 100644
+ import { useParams } from "react-router-dom";
+ import { toast } from "react-toastify";
+ import Pageheader from "../../components/pageheader/pageheader";
+ import { adjustOdd } from "../../modules/horse/utils/odds";
+ import { authService } from "../../services/api/authService";
+ import { tenantServiceInstance as axiosInstance } from "../../services/api/axiosConfig";
+ import useRaceOddsSocket from "../../modules/horse/hooks/useRaceOddsSocket";
+ odds: Array.isArray(market?.odds) ? market.odds.map(normalizeOddsRow) : [],
+ });
+ 
+ 
+ const formatValue = (value: number | null | undefined) =>
+   value === null || value === undefined
+     ? "-"
+     : Number(value).toFixed(2);
+