junebug12851/pokered-save-editor

View on GitHub
src/app/data/savefile-expanded/fragments/MapConnData.ts

Summary

Maintainability
A
45 mins
Test Coverage

Showing 13 of 13 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

constructor(saveFile?: SaveFileService, offset?: number) {
if (saveFile !== undefined)
this.load(saveFile as SaveFileService, offset as number);
}
Severity: Major
Found in src/app/data/savefile-expanded/fragments/MapConnData.ts and 3 other locations - About 45 mins to fix
src/app/data/savefile-expanded/fragments/HoFRecord.ts on lines 5..8
src/app/data/savefile-expanded/fragments/SignData.ts on lines 4..7
src/app/data/savefile-expanded/fragments/WarpData.ts on lines 4..7

Type string trivially inferred from a string literal, remove type annotation
Open

public map: string = "";

" should be '
Open

const map = this.map.split("_");

Type number trivially inferred from a number literal, remove type annotation
Open

public stripWidth: number = 0;

" should be '
Open

public map: string = "";

Missing radix parameter
Open

it.setByte(parseInt(map[1]));

Type number trivially inferred from a number literal, remove type annotation
Open

public yAlign: number = 0;

Type number trivially inferred from a number literal, remove type annotation
Open

public viewPtr: number = 0;

Type number trivially inferred from a number literal, remove type annotation
Open

public stripSrc: number = 0;

" should be '
Open

this.map = `${mapPtr.toString(16).padStart(2, "0").toUpperCase()}_${width}`;

if statements must be braced
Open

if (saveFile !== undefined)
this.load(saveFile as SaveFileService, offset as number);

Type number trivially inferred from a number literal, remove type annotation
Open

public xAlign: number = 0;

Type number trivially inferred from a number literal, remove type annotation
Open

public stripDest: number = 0;
Category
Status