Showing AI reviews for tenant-service
Project AI Score ?
67%
Quality Avg ?
69%
Security Avg ?
64%
Reviews ?
143

Review Result ?

solutionbowl/tenant-service · 00358b5d
The commit introduces calculated negative exposure values with rounding applied, which may be useful for reporting. However, the commit message is unclear and misspelled. Some improvements could be made in commit message clarity and potential verification of input data types to reduce bug risk.
Quality ?
70%
Security ?
80%
Business Value ?
60%
Maintainability ?
70%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Unclear And Misspelled
Where commit message
Issue / Evidence unclear and misspelled
Suggested Fix rewrite message to clearly convey the purpose and impact of the change
Missing Validation
Where src/controllers/horseracing/report.controller.js:3009
Issue / Evidence use of Number and negation without explicit input validation
Suggested Fix validate input before conversion to number to reduce bug risk
Similar To Line 3009
Where src/controllers/horseracing/report.controller.js:3010
Issue / Evidence similar to line 3009
Suggested Fix ensure exposureProfit is always numeric or handle non-numeric gracefully
Missing Validation
Where src/controllers/horseracing/report.controller.js:3012
Issue / Evidence input worstBook not validated
Suggested Fix add validation to ensure correct numeric input type
Missing Validation
Where src/controllers/horseracing/report.controller.js:3013
Issue / Evidence input bestBook not validated
Suggested Fix add validation for numeric input
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 09402cd..8d64f9b 100644
- ...marketData,
- totalStake: totalMarketStake,
- betsCount: totalMarketBets,
-             runners,
-             worstBook,
-             bestBook,
- };
- }),
- }))
Added / After Commit
+ diff --git a/src/controllers/horseracing/report.controller.js b/src/controllers/horseracing/report.controller.js
+ index 09402cd..8d64f9b 100644
+ ...marketData,
+ totalStake: totalMarketStake,
+ betsCount: totalMarketBets,
+             runners: runners.map((runner) => ({
+               ...runner,
+               exposure: round2(-Number(runner.exposure || 0)),
+               exposureProfit: round2(-Number(runner.exposureProfit || 0)),
+             })),
+             worstBook: round2(-Number(worstBook || 0)),
+             bestBook: round2(-Number(bestBook || 0)),
+ };
+ }),
+ }))