junebug12851/pokered-save-editor

View on GitHub
src/app/fragments/card-sprite-header/card-sprite-header.component.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 7 of 8 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Invalid

ngOnInit() {
const sprites: Sprite[] = this.gd.file("sprites").data;
sprites.forEach((el: Sprite) => {
this.sprites[el.ind] = el;
});
src/app/fragments/card-sprite/card-sprite.component.ts on lines 34..39

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

public get spriteName() {
const data = this.sprites[this.entry.pictureID];
if (data === null || data === undefined || !(this.entry.pictureID > 0))
return "";
else
src/app/fragments/card-sprite/card-sprite.component.ts on lines 50..56

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

public disabled: boolean = false;

" should be '
Open

const sprites: Sprite[] = this.gd.file("sprites").data;

else statements must be braced
Open

else
return data.name;

" should be '
Open

return "";

if statements must be braced
Open

if (data === null || data === undefined || !(this.entry.pictureID > 0))
return "";

The name of the class CardSpriteHeader should end with the suffix Component (https://angular.io/styleguide#style-02-03)
Open

export class CardSpriteHeader implements OnInit {
Category
Status