Skip to content

fix: remove 5 unused imports flagged by SonarQube#104

Open
sonarqube-agent[bot] wants to merge 1 commit intomainfrom
remediate-main-20260508-090159-22a69978
Open

fix: remove 5 unused imports flagged by SonarQube#104
sonarqube-agent[bot] wants to merge 1 commit intomainfrom
remediate-main-20260508-090159-22a69978

Conversation

@sonarqube-agent
Copy link
Copy Markdown

Removes unused imports of 'DsService', 'environment', 'HttpClient', 'HttpErrorResponse', and 'throwError' from multiple components. This eliminates SonarQube code smells and reduces unnecessary bundle weight without affecting functionality.

View Project in SonarCloud


Fixed Issues

typescript:S1128 - Remove this unused import of 'DsService'. • MINORView issue

Location: psc-admin-portal/src/app/ds/header/menu/accessibilite/accessibilite.component.ts:19

Why is this an issue?

Unnecessary imports refer to importing modules, libraries, or dependencies that are not used or referenced anywhere in the code. These imports do not contribute to the functionality of the application and only add extra weight to the JavaScript bundle, leading to potential performance and maintainability issues.

What changed

Removes the unused import of 'DsService' from 'accessibilite.component.ts'. The static analysis flagged this import as unnecessary because 'DsService' is not referenced anywhere in the file, adding unnecessary weight to the bundle. Removing it resolves the unused import code smell.

--- a/psc-admin-portal/src/app/ds/header/menu/accessibilite/accessibilite.component.ts
+++ b/psc-admin-portal/src/app/ds/header/menu/accessibilite/accessibilite.component.ts
@@ -19,1 +18,0 @@ import { DsPopup } from '../../../ds-popup.component';
-import { DsService } from '../../../ds.service';
typescript:S1128 - Remove this unused import of 'environment'. • MINORView issue

Location: psc-admin-portal/src/app/app.component.ts:22

Why is this an issue?

Unnecessary imports refer to importing modules, libraries, or dependencies that are not used or referenced anywhere in the code. These imports do not contribute to the functionality of the application and only add extra weight to the JavaScript bundle, leading to potential performance and maintainability issues.

What changed

This hunk removes the unused import of 'throwError' from 'rxjs' and the unused import of 'environment' from '../environments/environment'. Neither symbol was referenced anywhere in the code, so removing these two import lines eliminates both unnecessary import warnings.

--- a/psc-admin-portal/src/app/app.component.ts
+++ b/psc-admin-portal/src/app/app.component.ts
@@ -21,2 +19,0 @@ import {NavigationEnd, Router, RouterOutlet} from '@angular/router';
-import {throwError} from 'rxjs';
-import {environment} from '../environments/environment';
typescript:S1128 - Remove this unused import of 'HttpClient'. • MINORView issue

Location: psc-admin-portal/src/app/app.component.ts:17

Why is this an issue?

Unnecessary imports refer to importing modules, libraries, or dependencies that are not used or referenced anywhere in the code. These imports do not contribute to the functionality of the application and only add extra weight to the JavaScript bundle, leading to potential performance and maintainability issues.

What changed

This hunk removes the unused imports of 'HttpClient' and 'HttpErrorResponse' from '@angular/common/http'. Neither symbol was referenced anywhere in the code, so removing this entire import line eliminates both unnecessary import warnings for these two symbols.

--- a/psc-admin-portal/src/app/app.component.ts
+++ b/psc-admin-portal/src/app/app.component.ts
@@ -17,1 +16,0 @@
-import {HttpClient, HttpErrorResponse} from '@angular/common/http';
typescript:S1128 - Remove this unused import of 'HttpErrorResponse'. • MINORView issue

Location: psc-admin-portal/src/app/app.component.ts:17

Why is this an issue?

Unnecessary imports refer to importing modules, libraries, or dependencies that are not used or referenced anywhere in the code. These imports do not contribute to the functionality of the application and only add extra weight to the JavaScript bundle, leading to potential performance and maintainability issues.

What changed

This hunk removes the unused imports of 'HttpClient' and 'HttpErrorResponse' from '@angular/common/http'. Neither symbol was referenced anywhere in the code, so removing this entire import line eliminates both unnecessary import warnings for these two symbols.

--- a/psc-admin-portal/src/app/app.component.ts
+++ b/psc-admin-portal/src/app/app.component.ts
@@ -17,1 +16,0 @@
-import {HttpClient, HttpErrorResponse} from '@angular/common/http';
typescript:S1128 - Remove this unused import of 'throwError'. • MINORView issue

Location: psc-admin-portal/src/app/app.component.ts:21

Why is this an issue?

Unnecessary imports refer to importing modules, libraries, or dependencies that are not used or referenced anywhere in the code. These imports do not contribute to the functionality of the application and only add extra weight to the JavaScript bundle, leading to potential performance and maintainability issues.

What changed

This hunk removes the unused import of 'throwError' from 'rxjs' and the unused import of 'environment' from '../environments/environment'. Neither symbol was referenced anywhere in the code, so removing these two import lines eliminates both unnecessary import warnings.

--- a/psc-admin-portal/src/app/app.component.ts
+++ b/psc-admin-portal/src/app/app.component.ts
@@ -21,2 +19,0 @@ import {NavigationEnd, Router, RouterOutlet} from '@angular/router';
-import {throwError} from 'rxjs';
-import {environment} from '../environments/environment';

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZZjKfTT4RkVRlFrkaO- for typescript:S1128 rule
- AZZjKfX74RkVRlFrkaQR for typescript:S1128 rule
- AZZjKfX74RkVRlFrkaQS for typescript:S1128 rule
- AZZjKfX74RkVRlFrkaQT for typescript:S1128 rule
- AZZjKfX74RkVRlFrkaQU for typescript:S1128 rule

Generated by SonarQube Agent (task: 1b00c848-2b12-4052-b082-38c4a1b4ddac)
@sonarqube-agent
Copy link
Copy Markdown
Author

⚠️ This repository does not have a CODEOWNERS file. The PR has been created but has not been automatically assigned to any reviewer. To ensure PRs are reviewed promptly, consider adding a CODEOWNERS file to your repository.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants