Skip to content

Comments

chore(all-services): fix sonarqube issues#2441

Open
vaibhavbhalla2505 wants to merge 1 commit intomasterfrom
GH-2440
Open

chore(all-services): fix sonarqube issues#2441
vaibhavbhalla2505 wants to merge 1 commit intomasterfrom
GH-2440

Conversation

@vaibhavbhalla2505
Copy link
Contributor

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:

  • Refactored conditional checks in BearerVerifierComponent to 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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-line comments with rule-specific suppressions across services and tests.
  • Updated BearerVerifierComponent conditional 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 disabling no-floating-promises, handle the promise properly (e.g., await in an async IIFE with try/catch, or add a .catch that 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.

@vaibhavbhalla2505 vaibhavbhalla2505 changed the title fix(chore): fix sonarqube issues fix(all-services): fix sonarqube issues Feb 24, 2026
@vaibhavbhalla2505 vaibhavbhalla2505 changed the title fix(all-services): fix sonarqube issues chore(all-services): fix sonarqube issues Feb 24, 2026
@sonarqubecloud
Copy link

SonarQube reviewer guide

Summary: Improve ESLint rule specificity by replacing generic eslint-disable-next-line comments with explicit rule names, and refactor null checks to use optional chaining operator.

Review Focus: The changes are straightforward but widespread. Pay attention to:

  1. Verify the optional chaining refactoring in bearer-verifier/component.ts maintains identical null-safety behavior
  2. Ensure all ESLint rule names are correctly specified (e.g., @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any) and match your linting configuration
  3. Check that test files weren't inadvertently modified beyond comment updates

Start review at: packages/core/src/components/bearer-verifier/component.ts. This file contains the only functional logic change (optional chaining), while all other modifications are comment-only linting improvements that are lower risk.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
42.9% Duplication on New Code

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.

fix sonarqube issues

1 participant