bito-code-review[bot] commented on code in PR #44148:
URL: https://github.com/apache/superset/pull/44148#discussion_r4179064808
##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts:
##########
@@ -66,30 +119,40 @@ function processScatterData(
categoryColumn,
]);
+ const parsedFixedRadius = parseMetricValue(fixedRadiusValue);
+
return spatialFeatures.map(feature => {
let scatterPoint: ScatterPoint = {
position: feature.position,
extraProps: feature.extraProps || {},
};
+ // Reserved source columns live in extraProps to protect computed geometry.
+ const getSourceValue = (column?: string): unknown =>
+ column
+ ? feature.extraProps && column in feature.extraProps
+ ? feature.extraProps[column]
+ : feature[column]
+ : undefined;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>CWE-1113: Prototype-key `in` lookup</b></div>
<div id="fix">
`column in feature.extraProps` also matches Object.prototype keys
(`toString`, `constructor`; verified in node 20). A metric or dimension named
e.g. `constructor` resolves to the inherited function instead of the record
value, so `parseMetricValue` returns undefined and the radius is silently
dropped — a regression vs. the previous `feature[radiusMetricLabel]` read,
which own properties shadow. Use `Object.prototype.hasOwnProperty.call`, as
`Polygon/transformProps.ts` already does.
([CWE-1113](https://cwe.mitre.org/data/definitions/1113.html))
</div>
</div>
<small><i>Code Review Run #452a39</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]