Skip to content

Code Quality: PR #416 #1390

Code Quality: PR #416

Code Quality: PR #416 #1390

Triggered via dynamic May 23, 2026 18:01
Status Success
Total duration 1m 33s
Artifacts

codeql

on: dynamic
Matrix: analyze
Fit to window
Zoom out
Zoom in

Annotations

1 error and 5 warnings
Smoke test passes removed `x`/`y` params, breaking under new `elementRef`-only schema: src/mcp/tools/ui-automation/long_press.ts#L41
The e2e smoke test at `src/smoke-tests/__tests__/e2e-mcp-ui-automation.test.ts:239` calls `long_press` with `{ x: 150, y: 300, duration: 500 }`, but the schema no longer accepts `x` or `y` and now requires `elementRef` — this test will fail schema validation at runtime.
type-text success snapshot contract silently dropped: src/snapshot-tests/suites/ui-automation-suite.ts#L304
The `type-text--success` snapshot fixture and its test are removed entirely; the `type-text` suite now only validates error paths, leaving the success-path output contract unverified at the snapshot level.
foregroundScore counts root element's own actions as descendant foreground cues: src/mcp/tools/ui-automation/shared/runtime-next-steps.ts#L388
The `descendants` filter in `foregroundScore` does not exclude the root element itself, so a scrollable element's own `typeText` action, state, or dismiss label is counted as a foreground cue — potentially making it self-qualify as an active foreground root without any real child controls.
O(n²) foreground analysis runs twice per UI action: src/mcp/tools/ui-automation/shared/domain-result.ts#L298
Consider refactoring `setUiActionStructuredOutput` to compute `findActiveForegroundRoot` once and share the result, since `getForegroundCompletionSuppressedRuntimeTargetRefs` (line 298) and `createRuntimeSnapshotNextSteps` (line 315) each independently re-run the full O(n²) foreground detection on the same snapshot.
[U6J-K3K] O(n²) foreground analysis runs twice per UI action (additional location): src/mcp/tools/ui-automation/shared/runtime-next-steps.ts#L388
Consider refactoring `setUiActionStructuredOutput` to compute `findActiveForegroundRoot` once and share the result, since `getForegroundCompletionSuppressedRuntimeTargetRefs` (line 298) and `createRuntimeSnapshotNextSteps` (line 315) each independently re-run the full O(n²) foreground detection on the same snapshot.
[U6J-K3K] O(n²) foreground analysis runs twice per UI action (additional location): src/mcp/tools/ui-automation/shared/runtime-snapshot.ts#L432
Consider refactoring `setUiActionStructuredOutput` to compute `findActiveForegroundRoot` once and share the result, since `getForegroundCompletionSuppressedRuntimeTargetRefs` (line 298) and `createRuntimeSnapshotNextSteps` (line 315) each independently re-run the full O(n²) foreground detection on the same snapshot.