bito-code-review[bot] commented on code in PR #41132:
URL: https://github.com/apache/superset/pull/41132#discussion_r3468608257


##########
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx:
##########
@@ -346,9 +346,9 @@ class AdhocMetricEditPopover extends PureComponent<
       savedMetric: propsSavedMetric,
       columns,
       savedMetricsOptions,
-      onChange,
-      onClose,
-      onResize,
+      onChange: _onChange,
+      onClose: _onClose,
+      onResize: _onResize,

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Dead code from destructuring alias</b></div>
   <div id="fix">
   
   The underscore-prefixed aliases (`_onChange`, `_onClose`, `_onResize`) are 
never used in the component. Internal methods still call `this.props.onChange`, 
`this.props.onClose`, and `this.props.onResize` directly, so functionality is 
intact, but the destructuring aliases are dead code that obscure the actual 
behavior.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- 
a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx
    +++ 
b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx
    @@ -346,9 +346,6 @@ export default class AdhocMetricEditPopover extends 
PureComponent<AdhocMetricEd
           savedMetric: propsSavedMetric,
           columns,
           savedMetricsOptions,
    -      onChange: _onChange,
    -      onClose: _onClose,
    -      onResize: _onResize,
           datasource,
           isNewMetric = false,
           isLabelModified,
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #85ca94</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



##########
superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx:
##########
@@ -66,7 +66,7 @@ function findMatchingTimezone(
 export default function TimezoneSelector({
   onTimezoneChange,
   timezone,
-  minWidth = MIN_SELECT_WIDTH,
+  minWidth: _minWidth = MIN_SELECT_WIDTH,

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Unused prop silently discarded</b></div>
   <div id="fix">
   
   The `minWidth` prop is destructured as `_minWidth` and never used in the 
function body — the component hardcodes `MIN_SELECT_WIDTH` ('400px') instead. 
This silently discards callers' width values. `AlertReportModal.tsx:2683` 
passes `minWidth="100%"` which has no effect. Either remove the unused 
parameter or use it in the `<Select>` component.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #85ca94</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



##########
superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx:
##########
@@ -34,7 +34,7 @@ export const Label = forwardRef<HTMLSpanElement, 
LabelProps>((props, ref) => {
     onClick,
     children,
     icon,
-    id,
+    id: _id,

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Dead code drops id prop</b></div>
   <div id="fix">
   
   The `id` prop is destructured and renamed to `_id`, but `_id` is never used. 
This silently drops the `id` prop that callers pass, breaking the component's 
contract with consumers who rely on `id` for testing, accessibility, or CSS 
targeting. Revert to `id,` so it passes through `{...rest}` to `<Tag>`.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- 
superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx 
(lines 34-40) ---
    34:     onClick,
    35:     children,
    36:     icon,
    37: -    id: _id,
    37: +    id,
    38:     ...rest
    39:   } = props;
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #85ca94</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]

Reply via email to