From 264ad8c0fc23f5b14e33b418a963d9041834eae5 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 11 Aug 2021 11:02:25 +0200
Subject: [PATCH] sonarqube issues

---
 .../apps/goofy/src/environments/environment.ts |  1 -
 goofy-client/apps/goofy/src/polyfills.ts       |  2 --
 .../lib/navigation/navigation.component.html   | 18 ------------------
 .../postfach-detail-container.component.ts     | 15 +++++----------
 .../postfach-mail/postfach-mail.component.scss |  5 +----
 .../libs/tech-shared/src/lib/date.util.ts      |  6 ++----
 .../lib/interceptor/http-xsrf.interceptor.ts   |  8 ++++----
 .../libs/test-utils/src/lib/mocking.ts         |  8 ++++----
 .../formcontrol-editor.abstract.component.ts   |  4 ++--
 .../internal-server-error-dialog.component.ts  | 12 ++++++------
 ...-user-profile-button-container.component.ts |  2 +-
 .../_vorgang-search-container.theme.scss       |  5 -----
 12 files changed, 25 insertions(+), 61 deletions(-)

diff --git a/goofy-client/apps/goofy/src/environments/environment.ts b/goofy-client/apps/goofy/src/environments/environment.ts
index 8acdf29e56..714b00b239 100644
--- a/goofy-client/apps/goofy/src/environments/environment.ts
+++ b/goofy-client/apps/goofy/src/environments/environment.ts
@@ -14,4 +14,3 @@ export const environment = {
  * This import should be commented out in production mode because it will have a negative impact
  * on performance if an error is thrown.
  */
-// import 'zone.js/plugins/zone-error';  // Included with Angular CLI.
diff --git a/goofy-client/apps/goofy/src/polyfills.ts b/goofy-client/apps/goofy/src/polyfills.ts
index 7338712a33..6be8138f82 100644
--- a/goofy-client/apps/goofy/src/polyfills.ts
+++ b/goofy-client/apps/goofy/src/polyfills.ts
@@ -19,14 +19,12 @@
  */
 
 /** IE10 and IE11 requires the following for NgClass support on SVG elements */
-// import 'classlist.js';  // Run `npm install --save classlist.js`.
 
 /**
  * Web Animations `@angular/platform-browser/animations`
  * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
  * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
  */
-// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
 
 /**
  * By default, zone.js will patch all possible macroTask and DomEvents
diff --git a/goofy-client/libs/navigation/src/lib/navigation/navigation.component.html b/goofy-client/libs/navigation/src/lib/navigation/navigation.component.html
index a80302c38f..62a54310ce 100644
--- a/goofy-client/libs/navigation/src/lib/navigation/navigation.component.html
+++ b/goofy-client/libs/navigation/src/lib/navigation/navigation.component.html
@@ -12,23 +12,5 @@
 				<ng-template #homeInactive><span>Alle Vorgänge</span></ng-template>
 			</a>
 		</li>
-		<!--li>
-			<a href="#" matRipple matRippleColor="rgba(#000, 0.1)">
-				<mat-icon>star</mat-icon>
-				<span>Mir zugeordnet</span>
-			</a>
-		</li>
-		<li>
-			<a href="#">
-				<mat-icon>update</mat-icon>
-				<span>Wiedervorlagen</span>
-			</a>
-		</li>
-		<li>
-			<a href="#">
-				<mat-icon>delete</mat-icon>
-				<span>Gelöscht</span>
-			</a>
-		</li-->
 	</ul>
 </nav>
diff --git a/goofy-client/libs/postfach/src/lib/postfach-detail-container/postfach-detail-container.component.ts b/goofy-client/libs/postfach/src/lib/postfach-detail-container/postfach-detail-container.component.ts
index 4922051eb7..24f6fd950d 100644
--- a/goofy-client/libs/postfach/src/lib/postfach-detail-container/postfach-detail-container.component.ts
+++ b/goofy-client/libs/postfach/src/lib/postfach-detail-container/postfach-detail-container.component.ts
@@ -1,15 +1,10 @@
-import { Component, OnInit } from '@angular/core';
+import { Component } from '@angular/core';
 
 @Component({
-  selector: 'goofy-client-postfach-detail-container',
-  templateUrl: './postfach-detail-container.component.html',
-  styleUrls: ['./postfach-detail-container.component.scss']
+	selector: 'goofy-client-postfach-detail-container',
+	templateUrl: './postfach-detail-container.component.html',
+	styleUrls: ['./postfach-detail-container.component.scss']
 })
-export class PostfachDetailContainerComponent implements OnInit {
-
-  constructor() { }
-
-  ngOnInit(): void {
-  }
+export class PostfachDetailContainerComponent {
 
 }
diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.scss b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.scss
index 32cc417950..226649b09f 100644
--- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.scss
+++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.scss
@@ -13,6 +13,7 @@
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
+		color: rgba(#000, 0.4);
 	}
 
 	.receiver {
@@ -23,8 +24,4 @@
 		font-size: 12px;
 		color: rgba(#000, 0.4);
 	}
-
-	.message {
-		color: rgba(#000, 0.4);
-	}
 }
diff --git a/goofy-client/libs/tech-shared/src/lib/date.util.ts b/goofy-client/libs/tech-shared/src/lib/date.util.ts
index 9ce8329468..44e1672aaf 100644
--- a/goofy-client/libs/tech-shared/src/lib/date.util.ts
+++ b/goofy-client/libs/tech-shared/src/lib/date.util.ts
@@ -23,15 +23,13 @@ export function formatWithTime(date: Date): string {
 	return formatDate(date, 'dd.MM.y, H:mm:ss', 'de');
 }
 
-export function formatForThisYear(date): string {
+export function formatForThisYear(date: Date): string {
 	return formatDate(date, 'd.MMM', 'de');
 }
 
-//TODO: besseren Namen finden
-export function formatDMYDate(date): string {
+export function formatDMYDate(date: Date): string {
 	return formatDate(date, 'dd.MM.yyyy', 'de');
 }
-//
 
 export function isToday(date: Date): boolean {
 	return moment().isSame(date, 'day');
diff --git a/goofy-client/libs/tech-shared/src/lib/interceptor/http-xsrf.interceptor.ts b/goofy-client/libs/tech-shared/src/lib/interceptor/http-xsrf.interceptor.ts
index 087287dda0..0ee4de4e96 100644
--- a/goofy-client/libs/tech-shared/src/lib/interceptor/http-xsrf.interceptor.ts
+++ b/goofy-client/libs/tech-shared/src/lib/interceptor/http-xsrf.interceptor.ts
@@ -1,16 +1,16 @@
-import { Injectable } from '@angular/core';
 import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpXsrfTokenExtractor } from '@angular/common/http';
+import { Injectable } from '@angular/core';
 import { Observable } from 'rxjs';
 
 @Injectable()
 export class HttpXsrfInterceptor implements HttpInterceptor {
 
-	constructor(private tokenExtractor: HttpXsrfTokenExtractor) {}
+	constructor(private tokenExtractor: HttpXsrfTokenExtractor) { }
 
 	intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
-		if(HttpXsrfInterceptor.isChangingDataRequest(request)) {
+		if (HttpXsrfInterceptor.isChangingDataRequest(request)) {
 			const headerName = 'X-XSRF-TOKEN';
-			let token = this.tokenExtractor.getToken() as string;
+			let token: string = this.tokenExtractor.getToken();
 			if (token !== null && !request.headers.has(headerName)) {
 				request = request.clone({ headers: request.headers.set(headerName, token) });
 			}
diff --git a/goofy-client/libs/test-utils/src/lib/mocking.ts b/goofy-client/libs/test-utils/src/lib/mocking.ts
index ce6f16b63d..761add0ae0 100644
--- a/goofy-client/libs/test-utils/src/lib/mocking.ts
+++ b/goofy-client/libs/test-utils/src/lib/mocking.ts
@@ -3,14 +3,14 @@ import { Component, EventEmitter, Type } from '@angular/core';
 export type Mock<T> = { [K in keyof T]: jest.Mock; };
 
 export function mock<T>(service: Type<T>): Mock<T> {
-	return <Mock<T>>Object.getOwnPropertyNames(service.prototype).reduce((mock, key) => ({
-		...mock,
+	return <Mock<T>>Object.getOwnPropertyNames(service.prototype).reduce((mockValue, key) => ({
+		...mockValue,
 		[key]: jest.fn()
 	}), (<any>{}));
 }
 
-export function useFromMock<T>(mock: Mock<T>): T {
-	return <T><any>mock;
+export function useFromMock<T>(mockToUse: Mock<T>): T {
+	return <T><any>mockToUse;
 }
 
 export function mockComponent(options: Component): Component {
diff --git a/goofy-client/libs/ui/src/lib/ui/editor/formcontrol-editor.abstract.component.ts b/goofy-client/libs/ui/src/lib/ui/editor/formcontrol-editor.abstract.component.ts
index 79e5ebc841..3dc9e0875f 100644
--- a/goofy-client/libs/ui/src/lib/ui/editor/formcontrol-editor.abstract.component.ts
+++ b/goofy-client/libs/ui/src/lib/ui/editor/formcontrol-editor.abstract.component.ts
@@ -10,8 +10,8 @@ import { Subscription } from 'rxjs';
 export abstract class FormControlEditorAbstractComponent implements ControlValueAccessor {
 
 	readonly fieldControl: FormControl = new FormControl();
-	private onChange = (text: string) => { };
-	public onTouched = () => { };
+	private onChange = (text: string) => undefined;
+	public onTouched = () => undefined;
 
 	private changesSubscr: Subscription;
 	private statusSubscr: Subscription;
diff --git a/goofy-client/libs/ui/src/lib/ui/notification/internal-server-error-dialog/internal-server-error-dialog.component.ts b/goofy-client/libs/ui/src/lib/ui/notification/internal-server-error-dialog/internal-server-error-dialog.component.ts
index ed14db8286..e8d74bc770 100644
--- a/goofy-client/libs/ui/src/lib/ui/notification/internal-server-error-dialog/internal-server-error-dialog.component.ts
+++ b/goofy-client/libs/ui/src/lib/ui/notification/internal-server-error-dialog/internal-server-error-dialog.component.ts
@@ -1,13 +1,13 @@
-import { Component, OnInit } from '@angular/core';
+import { Component } from '@angular/core';
 import { OAuthService } from 'angular-oauth2-oidc';
 
 @Component({
-  selector: 'goofy-client-internal-server-error-dialog',
-  templateUrl: './internal-server-error-dialog.component.html',
-  styleUrls: ['./internal-server-error-dialog.component.scss']
+	selector: 'goofy-client-internal-server-error-dialog',
+	templateUrl: './internal-server-error-dialog.component.html',
+	styleUrls: ['./internal-server-error-dialog.component.scss']
 })
 export class InternalServerErrorDialogComponent {
 
-  constructor(public authService: OAuthService) { }
+	constructor(public authService: OAuthService) { }
 
-}
+}
\ No newline at end of file
diff --git a/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts b/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts
index de1b163d3e..da76b6a9f6 100644
--- a/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts
+++ b/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts
@@ -16,7 +16,7 @@ export class AssignUserProfileButtonContainerComponent {
 	constructor(private userProfileService: UserProfileService) { }
 
 	showUserProfileSearch(): void {
-		this.scrollToTop(); // TODO bessere loesung finden
+		this.scrollToTop(); // TODO bessere loesung finden: Zum Element scrollen!?
 		this.userProfileService.showUserProfileSearch();
 	}
 
diff --git a/goofy-client/libs/vorgang-shared-ui/src/lib/vorgang-search-container/_vorgang-search-container.theme.scss b/goofy-client/libs/vorgang-shared-ui/src/lib/vorgang-search-container/_vorgang-search-container.theme.scss
index c1ded1941a..c7f5926ca0 100644
--- a/goofy-client/libs/vorgang-shared-ui/src/lib/vorgang-search-container/_vorgang-search-container.theme.scss
+++ b/goofy-client/libs/vorgang-shared-ui/src/lib/vorgang-search-container/_vorgang-search-container.theme.scss
@@ -22,11 +22,6 @@ goofy-client-vorgang-search-container {
 body.dark goofy-client-vorgang-search-container {
 	.search-field {
 		background-color: $dark-background;
-
-		&:hover,
-		&:focus-within {
-
-		}
 	}
 
 	input::placeholder {
-- 
GitLab