Skip to content

Commit

Permalink
Fix sonar warnings for Web Client for AB#16872.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMaki committed Jan 6, 2025
1 parent 157573a commit 6ec1cde
Show file tree
Hide file tree
Showing 43 changed files with 151 additions and 144 deletions.
4 changes: 2 additions & 2 deletions Apps/WebClient/src/ClientApp/src/ioc/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ interface IContainer {
}

class Container implements IContainer {
private mappings = new Map<Identifier, (c: Container) => any>();
private cachedMappings = new Map<Identifier, any>();
private readonly mappings = new Map<Identifier, (c: Container) => any>();
private readonly cachedMappings = new Map<Identifier, any>();

public set<T>(key: Identifier, factory: (c: Container) => T): void {
this.mappings.set(key, factory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class BcCancerScreeningTimelineEntry extends TimelineEntry {
public fileName!: string;
public eventText!: string;

private getComments: (entryId: string) => UserComment[] | null;
private readonly getComments: (entryId: string) => UserComment[] | null;

public constructor(
model: BcCancerScreening,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class ClinicalDocumentTimelineEntry extends TimelineEntry {
public documentType: string;
public facilityName: string;
public discipline: string;
private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: ClinicalDocument,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class Covid19TestResultTimelineEntry extends TimelineEntry {

public tests: Covid19TestData[];

private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: Covid19LaboratoryOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class DiagnosticImagingTimelineEntry extends TimelineEntry {
public fileId: string | undefined;
public examDate: StringISODate;

private getComments: (entryId: string) => UserComment[] | null;
private readonly getComments: (entryId: string) => UserComment[] | null;

public constructor(
model: DiagnosticImagingExam,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class HealthVisitTimelineEntry extends TimelineEntry {
public specialtyDescription: string;
public clinic: ClinicViewModel;
public showRollOffWarning: boolean;
private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: Encounter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class HospitalVisitTimelineEntry extends TimelineEntry {
public admitDateTime: DateWrapper;
public endDateTime?: DateWrapper;

private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: HospitalVisit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class LabResultTimelineEntry extends TimelineEntry {

public tests: LaboratoryTestViewModel[];

private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: LaboratoryOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class MedicationTimelineEntry extends TimelineEntry {
public prescriptionProvided?: boolean;
public redirectedToHealthCareProvider?: boolean;

private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: MedicationStatement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class NoteTimelineEntry extends TimelineEntry {
public title: string;
public hdid: string;
public version?: number;
private static maxSumaryLength = 40;
private static readonly maxSumaryLength = 40;

public constructor(model: UserNote) {
super(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class SpecialAuthorityRequestTimelineEntry extends TimelineEntry
public expiryDate?: DateWrapper;
public referenceNumber: string;

private getComments: (entyId: string) => UserComment[] | null;
private readonly getComments: (entyId: string) => UserComment[] | null;

public constructor(
model: MedicationRequest,
Expand Down
2 changes: 1 addition & 1 deletion Apps/WebClient/src/ClientApp/src/services/httpDelegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { HttpError } from "@/models/errors";
import { IHttpDelegate, ILogger } from "@/services/interfaces";

export class HttpDelegate implements IHttpDelegate {
private logger;
private readonly logger;

constructor(logger: ILogger) {
this.logger = logger;
Expand Down
10 changes: 5 additions & 5 deletions Apps/WebClient/src/ClientApp/src/services/restAuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { IAuthenticationService, ILogger } from "@/services/interfaces";
const REFRESH_CUSHION = 30;

export class RestAuthenticationService implements IAuthenticationService {
private logger;
private keycloak;
private scope!: string;
private logonCallback!: string;
private logoutCallback!: string;
private readonly logger;
private readonly keycloak;
private readonly scope!: string;
private readonly logonCallback!: string;
private readonly logoutCallback!: string;

// RestAuthenticationService.GetService() should be called instead of using the constructor directly.
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestClinicalDocumentService implements IClinicalDocumentService {
private readonly BASE_URI = "ClinicalDocument";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestCommunicationService implements ICommunicationService {
private readonly BASE_URI: string = "Communication";
private logger;
private http;
private baseUri;
private readonly logger;
private readonly http;
private readonly baseUri;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { IConfigService, IHttpDelegate, ILogger } from "@/services/interfaces";
import ErrorTranslator from "@/utility/errorTranslator";

export class RestConfigService implements IConfigService {
private logger;
private readonly logger;
private readonly CONFIG_BASE_URI: string = "configuration";
private http;
private baseUri = import.meta.env.VITE_WEB_CLIENT_BASE_URI || "/";
private readonly http;
private readonly baseUri = import.meta.env.VITE_WEB_CLIENT_BASE_URI || "/";

constructor(logger: ILogger, httpDelegate: IHttpDelegate) {
this.logger = logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import RequestResultUtil from "@/utility/requestResultUtil";

export class RestDependentService implements IDependentService {
private readonly DEPENDENT_BASE_URI: string = "UserProfile";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestEncounterService implements IEncounterService {
private readonly ENCOUNTER_BASE_URI: string = "Encounter";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestHospitalVisitService implements IHospitalVisitService {
private readonly HOSPITAL_VISIT_BASE_URI: string = "Encounter";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestImmunizationService implements IImmunizationService {
private readonly IMMS_BASE_URI: string = "Immunization";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestLaboratoryService implements ILaboratoryService {
private readonly LABORATORY_BASE_URI: string = "Laboratory";
private logger;
private http;
private baseUri;
private isEnabled;
private isCovid19Enabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;
private readonly isCovid19Enabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestMedicationService implements IMedicationService {
private readonly BASE_URI: string = "MedicationStatement";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestNotificationService implements INotificationService {
private readonly NOTIFICATION_BASE_URI: string = "Notification";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const entryTypeToPatientDataTypeMap: Map<EntryType, PatientDataType> =

export class RestPatientDataService implements IPatientDataService {
private readonly BASE_URI = "PatientData";
private logger;
private http;
private baseUri;
private readonly logger;
private readonly http;
private readonly baseUri;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestPatientService implements IPatientService {
private readonly PATIENT_BASE_URI: string = "Patient";
private logger;
private http;
private baseUri;
private readonly logger;
private readonly http;
private readonly baseUri;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import RequestResultUtil from "@/utility/requestResultUtil";
export class RestPcrTestService implements IPcrTestService {
private readonly LABORATORY_BASE_URI: string = "Laboratory";
private readonly PUBLIC_LABORATORY_BASE_URI: string = "PublicLaboratory";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestReportService implements IReportService {
private readonly REPORT_BASE_URI: string = "Report";
private logger;
private http;
private baseUri;
private readonly logger;
private readonly http;
private readonly baseUri;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestSpecialAuthorityService implements ISpecialAuthorityService {
private readonly SPECIAL_AUTHORITY_BASE_URI: string = "MedicationRequest";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ILogger, ITrackingService } from "@/services/interfaces";
declare let window: SnowplowWindow;

export class RestTrackingService implements ITrackingService {
private logger;
private readonly logger;

constructor(logger: ILogger) {
this.logger = logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import RequestResultUtil from "@/utility/requestResultUtil";

export class RestUserCommentService implements IUserCommentService {
private readonly USER_COMMENT_BASE_URI: string = "UserProfile";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
6 changes: 3 additions & 3 deletions Apps/WebClient/src/ClientApp/src/services/restUserFeedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import ErrorTranslator from "@/utility/errorTranslator";

export class RestUserFeedbackService implements IUserFeedbackService {
private readonly USER_FEEDBACK_BASE_URI: string = "UserFeedback";
private logger;
private http;
private baseUri;
private readonly logger;
private readonly http;
private readonly baseUri;

constructor(
logger: ILogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import RequestResultUtil from "@/utility/requestResultUtil";

export class RestUserNoteService implements IUserNoteService {
private readonly USER_NOTE_BASE_URI: string = "Note";
private logger;
private http;
private baseUri;
private isEnabled;
private readonly logger;
private readonly http;
private readonly baseUri;
private readonly isEnabled;

constructor(
logger: ILogger,
Expand Down
Loading

0 comments on commit 6ec1cde

Please sign in to comment.