Skip to content

Fix CodeQL warnings in the admin and end-user UI - #210

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix-codeql-warnings-ui
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix-codeql-warnings-ui

Conversation

@vharseko

Copy link
Copy Markdown
Member

Summary

Last of the warning-level CodeQL batches: the JavaScript/template findings in the admin and end-user UI. 14 alerts fixed, 3 dismissed as false positives. No behavioural change — dead code, conditions that were always true, and two template attributes.

Alerts File Change
#909 redundant-assignment MarketoView.js if (_.isNull(x) && _.isObject(x)) { x = x; } — the condition can never hold and the body assigned the value to itself; removed.
#750/#751 trivial-conditional AssociationRuleView.js After the two !added branches, added is always true: else if (added && …)else if (…), else if (added)else.
#752 trivial-conditional ObjectTypesDialog.js return jsonEditorFormat || false — always an object.
#890 useless-assignment-to-local GenericEditResourceView.js showRelationships was declared and assigned but never called; removed. (Different hunk from the one #204 touches in this file.)
#889 CorrelationQueryBuilderView.js showExpressionMenu computed clickedEle and never used it — the menu is a Bootstrap dropdown; the handler now only stops the default action.
#881, #885–#888, #891, #892 RelationshipWidget, ManagedListView, SchemaEditorView ×3, FormGenerationUtils, SocialIdentitiesTab Dead local assignments removed (refreshSettings, icon initial value, forArray = false ×2, prop = _.extend(prop, …), formFieldType, oauthWindow).
#898 duplicate-html-attribute SSHConnector_1.4.html Duplicated data-validator-event.
#897 malformed-html-id Salesforce_2.0.html Empty id="" on a hidden input.

Dismissed as false positives: #882–#884 SyncDelegate.jsobject / source are read by the user-supplied condition/transform scripts evaluated through eval(...) on the following lines.

Test plan

  • Grunt builds of openidm-ui-common, openidm-ui-admin and openidm-ui-enduser: eslint clean, QUnit 93/93 (admin) and 2/2 (end-user), BUILD SUCCESS
  • CodeQL on this PR closes #750–#752, #881, #885–#892, #897, #898, #909

- MarketoView: drop an unreachable self-assignment block
- AssociationRuleView / ObjectTypesDialog: remove conditions that are
  always true
- Remove dead local assignments and the unused showRelationships helper
  (RelationshipWidget, ManagedListView, SchemaEditorView,
  CorrelationQueryBuilderView, GenericEditResourceView,
  FormGenerationUtils, SocialIdentitiesTab)
- SSH connector template: drop a duplicated attribute; Salesforce
  template: drop an empty id

Resolves CodeQL alerts #750-#752, #881, #885-#892, #897, #898, #909.
@vharseko vharseko added javascript Pull requests that update Javascript code refactor Code refactoring without behavior change labels Sep 18, 2026

obj.generateTemplateFromFormProperties = function(definition, formValues) {
var property, formTemplate = "", formFieldType, formFieldDescription, i;
var property, formTemplate = "", formFieldDescription, i;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code refactor Code refactoring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants