Skip to content

Diya fix(sonarqube): SonarQube fix for Dev to Main Release 2.98#2173

Closed
DiyaWadhwani wants to merge 1 commit intodevelopmentfrom
Diya_FixSonarqube_DevtoMain2.98
Closed

Diya fix(sonarqube): SonarQube fix for Dev to Main Release 2.98#2173
DiyaWadhwani wants to merge 1 commit intodevelopmentfrom
Diya_FixSonarqube_DevtoMain2.98

Conversation

@DiyaWadhwani
Copy link
Copy Markdown
Contributor

Description

Fixes SonarQube Quality Gate failures blocking the Backend Release 2.98 (dev → main merge, PR #2171).

Fixes: SonarQube Quality Gate — Dev to Main Release 2.98

Related PRs (if any):

This backend PR is related to the main release PR #2171 (Backend Release to Main [2.98]).

Main changes explained:

  • Updated src/controllers/jobsController.test.js to remove .then from the mock query chain object — SonarQube flagged adding then to a plain object as a reliability bug, and also added .lean() call in resetJobsFilters in jobsController.js to fix the failing test
  • Updated src/controllers/jobsController.js to add .lean() to the resetJobsFilters query chain which was missing it
  • Updated src/controllers/bmdashboard/bmConsumableController.js to stop logging user-controlled error data — replaced console.log('error: ', error) with a safe static message to fix the security vulnerability
  • Created src/scripts/scriptUtil.js as a shared utility exporting a reusable prompt function
  • Updated src/scripts/resetUserCatalog.js and src/scripts/resetUserStateSelections.js to import prompt from scriptUtil.js and remove the duplicated local prompt function — reduces code duplication from 62.3% to 0% on these files

@DiyaWadhwani
Copy link
Copy Markdown
Contributor Author

Tests passed, PR not required!

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant