junebug12851/pokered-save-editor

View on GitHub
src/app/data/pokemonDB.service.ts

Summary

Maintainability
D
2 days
Test Coverage

Showing 58 of 58 total issues

Function process2Pokemon has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

process2Pokemon() {
const self = this;
 
_.forOwn(this.pokemon, function(value: any) {
if(value.moves !== undefined) {
Severity: Major
Found in src/app/data/pokemonDB.service.ts - About 2 hrs to fix

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

if(value.type2 !== undefined && value._type2 === undefined) {
value._type2 = value.type2;
value.type2 = _.find(self.types, ['name', _.startCase(_.lowerCase(value.type2))]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 2 hrs to fix
src/app/data/pokemonDB.service.ts on lines 90..93
src/app/data/pokemonDB.service.ts on lines 136..139
src/app/data/pokemonDB.service.ts on lines 148..151

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

if(value.type !== undefined && value._type === undefined) {
value._type = value.type;
value.type = _.find(self.types, ['name', _.startCase(_.lowerCase(value.type))]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 2 hrs to fix
src/app/data/pokemonDB.service.ts on lines 136..139
src/app/data/pokemonDB.service.ts on lines 141..144
src/app/data/pokemonDB.service.ts on lines 148..151

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

if(value.type1 !== undefined && value._type1 === undefined) {
value._type1 = value.type1;
value.type1 = _.find(self.types, ['name', _.startCase(_.lowerCase(value.type1))]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 2 hrs to fix
src/app/data/pokemonDB.service.ts on lines 90..93
src/app/data/pokemonDB.service.ts on lines 141..144
src/app/data/pokemonDB.service.ts on lines 148..151

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

if(entry.item !== undefined && entry._item === undefined) {
entry._item = entry.item;
entry.item = _.find(self.items, ['name', _.startCase(_.lowerCase(entry.item))]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 2 hrs to fix
src/app/data/pokemonDB.service.ts on lines 90..93
src/app/data/pokemonDB.service.ts on lines 136..139
src/app/data/pokemonDB.service.ts on lines 141..144

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

if(value.hm !== undefined && value._hm === undefined) {
value._hm = value.hm;
value.hm = _.find(self.moves, ['hm', value.hm]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 1 hr to fix
src/app/data/pokemonDB.service.ts on lines 75..78
src/app/data/pokemonDB.service.ts on lines 94..97
src/app/data/pokemonDB.service.ts on lines 98..101

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

if(value.hm !== undefined && value._hm === undefined) {
value._hm = value.hm;
value.hm = _.find(self.items, ['_hm', value.hm]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 1 hr to fix
src/app/data/pokemonDB.service.ts on lines 75..78
src/app/data/pokemonDB.service.ts on lines 79..82
src/app/data/pokemonDB.service.ts on lines 94..97

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

if(value.tm !== undefined && value._tm === undefined) {
value._tm = value.tm;
value.tm = _.find(self.items, ['_tm', value.tm]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 1 hr to fix
src/app/data/pokemonDB.service.ts on lines 75..78
src/app/data/pokemonDB.service.ts on lines 79..82
src/app/data/pokemonDB.service.ts on lines 98..101

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

if(value.tm !== undefined && value._tm === undefined) {
value._tm = value.tm;
value.tm = _.find(self.moves, ['tm', value.tm]);
}
Severity: Major
Found in src/app/data/pokemonDB.service.ts and 3 other locations - About 1 hr to fix
src/app/data/pokemonDB.service.ts on lines 79..82
src/app/data/pokemonDB.service.ts on lines 94..97
src/app/data/pokemonDB.service.ts on lines 98..101

" should be '
Open

import { Type } from "../../assets/data/types";
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.rawPokemon = this.gd.file("pokemon").data;
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1(this.rawTypes, this.types, "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawTypes, this.types, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.type !== undefined && value._type === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.moves !== undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

import { Injectable } from "@angular/core";
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

const _ = window.require("lodash");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawItems, this.items, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawItems, this.items, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

import { GameDataService } from "./gameData.service";
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

import { Item } from "../../assets/data/items";
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawMoves, this.moves, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

import { Move } from "../../assets/data/moves";
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.rawMoves = this.gd.file("moves").data;
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

misplaced 'else'
Open

else
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

for(let i = 0; i < from.length; i++) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.tm !== undefined && value._tm === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.hm !== undefined && value._hm === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1(this.rawItems, this.items, "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

Missing semicolon
Open

}
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.tm !== undefined && value._tm === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

if statements must be braced
Open

if(move._move !== undefined)
continue;
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

else statements must be braced
Open

else
process(value.evolution);
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.rawTypes = this.gd.file("types").data;
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1(this.rawMoves, this.moves, "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

for(let i = 0; i < from.length; i++) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

for(let i = 0; i < value.moves.length; i++) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

if statements must be braced
Open

if(entry._toName !== undefined)
return;
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

import { Pokemon } from "../../assets/data/pokemon";
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawPokemon, this.pokemon, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawTypes, this.types, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.rawItems = this.gd.file("items").data;
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1(this.rawPokemon, this.pokemon, "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawMoves, this.moves, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

" should be '
Open

this.process1Alts(this.rawPokemon, this.pokemon, "ind", "name");
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.hm !== undefined && value._hm === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(move._move !== undefined)
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.evolution !== undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(entry.item !== undefined && entry._item === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.tmHm !== undefined && value._tmHm === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

for(let i = 0; i < value.evolution.length; i++) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.type1 !== undefined && value._type1 === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(entry._toName !== undefined)
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.initial !== undefined && value._initial === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

for(let i = 0; i < value.initial.length; i++) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(value.type2 !== undefined && value._type2 === undefined) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

if(Array.isArray(value.evolution)) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint

missing whitespace
Open

for(let i = 0; i < value.tmHm.length; i++) {
Severity: Minor
Found in src/app/data/pokemonDB.service.ts by tslint
Category
Status