Skip to content

Commit

Permalink
Merge pull request #10996 from qmonmert/sonar270924
Browse files Browse the repository at this point in the history
Sonar: 8 issues
  • Loading branch information
pascalgrimaud authored Sep 27, 2024
2 parents 41cd23f + c326d79 commit 3332511
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/main/webapp/app/module/domain/landscape/Landscape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ class LevelsProjections {
levels
.flatMap(level => level.elements)
.filter(element => element instanceof LandscapeFeature)
.map(feature => feature as LandscapeFeature)
.map(feature => [feature.slugString(), feature]),
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CursorType } from '@/module/primary/landscape/CursorType';

export class BodyCursorUpdater {
constructor(private window: Window) {}
constructor(private readonly window: Window) {}

set(cursorType: CursorType) {
this.window.document.body.style.cursor = cursorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class LandscapeNavigation {
private currentModule: number;
private currentElement: number;
private currentLevel: number;
private landscapeElements: Map<string, HTMLElement>;
private levels: LandscapeLevel[];
private readonly landscapeElements: Map<string, HTMLElement>;
private readonly levels: LandscapeLevel[];

constructor(landscapeElements: Map<string, HTMLElement>, levels: LandscapeLevel[]) {
[this.currentLevel, this.currentElement, this.currentModule] = this.setValues(0, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { RestModuleToApply, toRestModuleToApply } from './RestModuleToApply';
import { mapToModuleHistory, RestProjectHistory } from './RestProjectHistory';

export class RestModulesRepository implements ModulesRepository {
constructor(private axiosInstance: AxiosHttp) {}
constructor(private readonly axiosInstance: AxiosHttp) {}

list(): Promise<Modules> {
return this.axiosInstance.get<RestModules>('/api/modules').then(mapToModules);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AxiosHttp } from '@/shared/http/infrastructure/secondary/AxiosHttp';
import { ProjectFolder } from '../domain/ProjectFolder';

export class RestProjectFoldersRepository implements ProjectFoldersRepository {
constructor(private axiosInstance: AxiosHttp) {}
constructor(private readonly axiosInstance: AxiosHttp) {}

get(): Promise<ProjectFolder> {
return this.axiosInstance.get<ProjectFolder>('/api/project-folders').then(res => res.data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AlertType } from '@/shared/alert/infrastructure/secondary/AlertType';
import { Emitter } from 'mitt';

export class MittAlertBus implements AlertBus {
constructor(private emitter: Emitter<any>) {}
constructor(private readonly emitter: Emitter<any>) {}

success(alert: AlertMessage): void {
this.emitter.emit(AlertType.SUCCESS, alert);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AlertType } from '@/shared/alert/infrastructure/secondary/AlertType';
import { Emitter, Handler } from 'mitt';

export class MittAlertListener implements AlertListener {
constructor(private emitter: Emitter<any>) {}
constructor(private readonly emitter: Emitter<any>) {}

onSuccess(alerted: Alerted): Unsubscribe {
const handler: Handler<AlertMessage> = message => alerted(message);
Expand Down

0 comments on commit 3332511

Please sign in to comment.