Skip to content

made changes for Sonar Qube - #37

Merged
cB-Abhinav-Gautam merged 1 commit into
mainfrom
sonarQubeFix
Oct 13, 2025
Merged

cB-Abhinav-Gautam merged 1 commit into
mainfrom
sonarQubeFix

Conversation

@cB-GAUTAM-X

Copy link
Copy Markdown
Contributor

No description provided.

@cB-GAUTAM-X
cB-GAUTAM-X requested a review from a team as a code owner October 13, 2025 10:34
@codebucket-sonarqube

Copy link
Copy Markdown

Passed Quality Gate passed

Issues

Measures

Project ID: Codebucket-Solutions_node-template_f63a063e-1f88-4da3-b0be-b4fb5a006098

View in SonarQube

@DaraSingh1998 DaraSingh1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review

Inline comments were added on the changed files. See annotations below in the Files tab.


Every thing looks in order.


Summary

Error: Request failed with status code 502

@DaraSingh1998 DaraSingh1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review

Inline comments were added on the changed files. See annotations below in the Files tab.


Every thing looks in order.


Summary

Detailed High-Level Summary of Changes

This PR introduces several changes across multiple files, aimed at improving code quality, fixing potential bugs, and adding new dependencies. Below is a summary of the changes:

controllers/v1/general/general.js

  • Added a console.log("Create Api"); statement inside the createApi function.
    • Functional Impact: This change adds a logging statement that will output "Create Api" to the console whenever the createApi function is called. It can be useful for debugging purposes but should ideally be removed or replaced with a proper logging mechanism in production.

models/init-models.js

  • Changed variable declarations from var to let.
    • Functional Impact: This change updates the variable declaration style from var to let, which provides block-scoping instead of function-scoping. It can help prevent potential issues related to variable hoisting and scope management.

package-lock.json

  • Added prettier as a dev dependency.
    • Functional Impact: This change includes the Prettier code formatter in the project's development dependencies, enabling consistent code formatting across the team. The version specified is 3.5.3, but it was later resolved to 3.6.2.

service/v1/index.js

  • Removed a commented-out line.
    • Functional Impact: This change removes an unused comment from the file, cleaning up the code and making it more readable.

utils/hash.js

  • Improved error handling in bcrypt.hash and bcrypt.compare.
    • Functional Impact: This change ensures that errors are properly wrapped in Error objects if they are not already instances of Error. This can help prevent unexpected behavior when errors are thrown or caught elsewhere in the application.

utils/message-helper.js

  • Changed the return value from 0 to "0" in case of an error.
    • Functional Impact: This change ensures that the function returns a string instead of a number, which might be more consistent with other parts of the codebase or expected by consuming functions.

utils/notifications.js

  • Removed unused variable createdDate.
    • Functional Impact: This change removes an unused variable from the notification function, cleaning up the code and removing potential confusion about its purpose.

utils/search-util.js

  • Added const keyword to function declarations.
    • Functional Impact: This change ensures that the functions are block-scoped and prevents accidental reassignment, improving code safety and readability.
  • Improved conditional logic in checkForMatch.
    • Functional Impact: This change makes the conditional logic more readable by using an if statement instead of a ternary operator.

utils/time.js

  • Removed unused variable p.
    • Functional Impact: This change removes an unused variable, cleaning up the code and improving readability.
  • Updated variable declaration from var to let.
    • Functional Impact: Similar to other changes, this updates the variable declaration style to use block-scoping.

utils/upload.js

  • Improved error handling in formidableUpload.
    • Functional Impact: This change provides a more descriptive error message when the form is not parsed correctly. Additionally, it logs the error using console.error, which can help with debugging.
  • Changed error rethrowing to logging.
    • Functional Impact: Instead of rethrowing errors, this change logs them with a descriptive message, which can be more informative for debugging purposes.

Overall Summary

The PR aims to improve code quality and consistency across the project. It includes changes such as variable declaration updates, improved error handling, code cleanup, and the addition of a new development dependency (Prettier). These changes contribute to better maintainability and readability of the codebase. However, there are some minor improvements that could be made, such as removing debug logs before merging into production.

@cB-Abhinav-Gautam
cB-Abhinav-Gautam merged commit 973b3c9 into main Oct 13, 2025
4 of 5 checks passed
@engineering-fabric
engineering-fabric Bot deleted the sonarQubeFix branch October 13, 2025 10:39
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.

3 participants