chore(all-services): fix sonarqube issues#2441
chore(all-services): fix sonarqube issues#2441vaibhavbhalla2505 wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses SonarQube/code-quality findings by tightening ESLint suppression directives (specifying exact rules) and modernizing a conditional in the bearer verifier component.
Changes:
- Replaced generic
eslint-disable-next-linecomments with rule-specific suppressions across services and tests. - Updated
BearerVerifierComponentconditional checks to use optional chaining (this.config?.type). - Minor lint-targeted refactors in sandbox/service entrypoints and payment models/providers.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/user-tenant-service/src/services/user-operations.service.ts | Narrows ESLint suppression to @typescript-eslint/ban-ts-comment around TS directive usage. |
| services/payment-service/src/providers/razorpay/razorpay.provider.ts | Adds explicit @typescript-eslint/naming-convention suppressions for Razorpay snake_case fields. |
| services/payment-service/src/models/transactions.model.ts | Adds explicit @typescript-eslint/no-explicit-any suppressions for any fields/indexer. |
| services/payment-service/src/models/payment-gateways.model.ts | Adds explicit @typescript-eslint/no-explicit-any suppression for indexer any. |
| services/payment-service/src/models/orders.model.ts | Adds explicit @typescript-eslint/no-explicit-any suppression for indexer any. |
| services/authentication-service/src/tests/acceptance/otp.controller.acceptance.ts | Adds explicit @typescript-eslint/naming-convention suppressions for snake_case request fields. |
| services/authentication-service/src/tests/acceptance/login.controller.acceptance.ts | Adds explicit @typescript-eslint/naming-convention suppressions for snake_case request fields. |
| sandbox/telemed-app/backend/authentication-service/src/index.ts | Changes ESLint suppression to @typescript-eslint/no-floating-promises for the secrets bootstrap call. |
| packages/core/src/components/bearer-verifier/component.ts | Refactors config type checks to use optional chaining. |
Comments suppressed due to low confidence (1)
sandbox/telemed-app/backend/authentication-service/src/index.ts:44
getSecretValue()is invoked with.then(...)but without any rejection handling; if Secrets Manager access fails, this can trigger an unhandled promise rejection and the process may crash without a clear error path. Instead of disablingno-floating-promises, handle the promise properly (e.g.,awaitin an async IIFE withtry/catch, or add a.catchthat logs and exits).
// eslint-disable-next-line @typescript-eslint/no-floating-promises
getSecretValue().then(res => {
Object.assign(process.env, res);
main(config).catch(err => {
console.error('Cannot start the application.', err); // NOSONAR
process.exit(1);
});
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d5670e4 to
8dcc10e
Compare
8dcc10e to
ae32a09
Compare
SonarQube reviewer guideSummary: Improve ESLint rule specificity by replacing generic Review Focus: The changes are straightforward but widespread. Pay attention to:
Start review at:
|



Description
This pull request primarily improves code quality and consistency by updating TypeScript linting comments and refactoring conditional checks. The main focus is on enforcing naming conventions and modernizing code syntax for better reliability and maintainability.
Code Modernization:
BearerVerifierComponentto use optional chaining (this.config?.type) instead of verbose null checks, improving readability and reducing potential errors.Fixes #2440
Type of change
Please delete options that are not relevant.
Checklist: