OSS Conductor UI V2#852
Conversation
- prettier ignore pnpm-lock.yaml - Create a README - Throw error if browser does not support crypto as the browsers we support should have crypto
…ublish specific versions
| // Remove <map value> markers | ||
| .replace(/<map value>/g, "") | ||
| // Clean up any double brackets that might have been created | ||
| .replace(/\]\[/g, "][") |
Check warning
Code scanning / CodeQL
Replacement of a substring with itself Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
In general, to fix this kind of problem you either (1) correct the replacement so it transforms the string as actually intended, or (2) remove the replacement entirely if no transformation is needed. Here, there is no evidence of a different intended form of "]["; the comment says “Clean up any double brackets that might have been created,” but the code already operates on well-formed bracket syntax, and there’s no prior step that would introduce a malformed alternative representation of "][" to normalize. The safest fix that preserves existing functionality is to drop the no-op replacement call.
Concretely, in ui-next/src/pages/definition/errorInspector/state/helpers.ts, within jakatraPathToPropertyPath, remove the .replace(/\]\[/g, "][") call and its preceding comment. This eliminates the redundant operation and the CodeQL finding without altering the resulting string for any input, because the step was previously a pure no-op.
| @@ -190,8 +190,6 @@ | ||
| .replace(/<list element>/g, "") | ||
| // Remove <map value> markers | ||
| .replace(/<map value>/g, "") | ||
| // Clean up any double brackets that might have been created | ||
| .replace(/\]\[/g, "][") | ||
| // Remove any dots that appear right before a bracket | ||
| .replace(/\.\[/g, "[") | ||
| ); |
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApplyto fix any format violations.Changes in this PR
Updated conductor-ui v2