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
?
67%
Quality Avg
?
69%
Security Avg
?
64%
Reviews
?
143
Review Result ?
solutionbowl/tenant-service · b2205975
The commit adds a utility function to round numbers to two decimal places for net exposure calculations. While useful, the commit lacks context, tests, or usage examples, limiting its demonstrated business value and overall quality. The commit message is vague and does not clearly explain the purpose or impact of the change.
Quality
?
40%
Security
?
50%
Business Value
?
30%
Maintainability
?
40%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Vague And Unclear
Where
commit message
Issue / Evidence
vague and unclear
Suggested Fix
improve the commit message to clearly describe the problem fixed and the impact of this rounding function
Missing Test Coverage
Where
src/controllers/horseracing/report.controller.js:12
Issue / Evidence
no usage or tests for the new round2 function
Suggested Fix
add examples or tests showing how round2 is used in the net exposure calculations to increase confidence
Function Handles Only Number Or Falsy Inpu...
Where
src/controllers/horseracing/report.controller.js:12
Issue / Evidence
function handles only number or falsy inputs
Suggested Fix
add input validation or documentation to specify accepted inputs clearly
Code Change Preview · src/controllers/horseracing/report.controller.js
?
Removed / Before Commit
- diff --git a/src/controllers/horseracing/report.controller.js b/src/controllers/horseracing/report.controller.js - index 442cc89..2b1a603 100644 - const toGrossMultiOdds = (value, fallback = 0) => - Number((Number(value ?? fallback ?? 0) + 1).toFixed(2)); - - exports.getGlobalRaceProfitLoss = async (req, res) => { - try { - const { fromDate, toDate } = req.body;
Added / After Commit
+ diff --git a/src/controllers/horseracing/report.controller.js b/src/controllers/horseracing/report.controller.js + index 442cc89..2b1a603 100644 + const toGrossMultiOdds = (value, fallback = 0) => + Number((Number(value ?? fallback ?? 0) + 1).toFixed(2)); + + const round2 = (value) => Math.round(Number(value || 0) * 100) / 100; + + exports.getGlobalRaceProfitLoss = async (req, res) => { + try { + const { fromDate, toDate } = req.body;