junebug12851/pokered-save-editor

View on GitHub

Showing 2,649 of 2,664 total issues

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

if(this.grassRate > 0) {
const grassPokemon = saveFile.getRange(0x2B34, 20);
 
this.grassPokemon = [];
for (let i = 0; i < 20; i += 2) {
Severity: Major
Found in src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts and 1 other location - About 7 hrs to fix
src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts on lines 45..66

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

if(this.waterPokemonRate > 0) {
const waterPokemon = saveFile.getRange(0x2B51, 20);
 
this.waterPokemon = [];
for (let i = 0; i < 20; i += 2) {
Severity: Major
Found in src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts and 1 other location - About 7 hrs to fix
src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts on lines 19..40

CardPokemonComponent has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

@Component({
selector: 'card-pokemon',
templateUrl: './card-pokemon.component.pug',
styleUrls: ['./card-pokemon.component.scss'],
})
Severity: Minor
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts - About 4 hrs to fix

File card-pokemon.component.ts has 325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { OnInit, Output, EventEmitter } from '@angular/core';
 
/**
Copyright 2018 June Hanabi
 
 
Severity: Minor
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts - About 3 hrs to fix

File PokemonBox.ts has 321 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { SaveFileIterator } from './../SaveFileIterator';
import { SaveFileService } from './../../savefile.service';
import {Pokemon} from '../../../../assets/data/pokemon';
import { GameDataService } from '../../gameData.service';
import { PokemonDBService } from '../../pokemonDB.service';
Severity: Minor
Found in src/app/data/savefile-expanded/fragments/PokemonBox.ts - About 3 hrs to fix

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

get missablesFiltered() {
const missables = this.missables;
 
if (this.search == "")
return missables;
src/app/screens/world-hidden/world-hidden.component.ts on lines 49..60
src/app/screens/world-scripts/world-scripts.component.ts on lines 46..57

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

get scriptsFiltered() {
const scripts = this.scripts;
 
if (this.search == "")
return scripts;
Severity: Major
Found in src/app/screens/world-scripts/world-scripts.component.ts and 2 other locations - About 3 hrs to fix
src/app/screens/world-hidden/world-hidden.component.ts on lines 49..60
src/app/screens/world-missables/world-missables.component.ts on lines 45..56

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

get itemsFiltered() {
const items = this.items;
 
if (this.search == "")
return items;
Severity: Major
Found in src/app/screens/world-hidden/world-hidden.component.ts and 2 other locations - About 3 hrs to fix
src/app/screens/world-missables/world-missables.component.ts on lines 45..56
src/app/screens/world-scripts/world-scripts.component.ts on lines 46..57

Function onSpeciesChange has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

public onSpeciesChange() {
this.updateData();
 
const species = this.pdb.pokemon[this.entry.species];
if(species == undefined || species.name == undefined)
Severity: Minor
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts - About 3 hrs to fix

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

if(this.grassRate > 0) {
it.offsetTo(0x2B34);
for (let i = 0; i < 10; i++) {
it.setByte(this.grassPokemon[i].level);
it.setByte(this.grassPokemon[i].pokemon);
Severity: Major
Found in src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts and 1 other location - About 3 hrs to fix
src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts on lines 88..94

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

if(this.waterPokemonRate > 0) {
it.offsetTo(0x2B51);
for (let i = 0; i < 10; i++) {
it.setByte(this.waterPokemon[i].level);
it.setByte(this.waterPokemon[i].pokemon);
Severity: Major
Found in src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts and 1 other location - About 3 hrs to fix
src/app/data/savefile-expanded/sections/Area/AreaPokemon.ts on lines 77..83

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

doMaxEVs() {
this.entry.hpExp = 0xFFFF;
this.entry.attackExp = 0xFFFF;
this.entry.defenseExp = 0xFFFF;
this.entry.speedExp = 0xFFFF;
Severity: Major
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts and 1 other location - About 2 hrs to fix
src/app/fragments/card-pokemon/card-pokemon.component.ts on lines 245..252

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

doResetEVs() {
this.entry.hpExp = 0;
this.entry.attackExp = 0;
this.entry.defenseExp = 0;
this.entry.speedExp = 0;
Severity: Major
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts and 1 other location - About 2 hrs to fix
src/app/fragments/card-pokemon/card-pokemon.component.ts on lines 228..235

Function genPokemonAndGive has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

genPokemonAndGive(entry: EventPokemon) {
// Get a blank Pokemon with random DV's and OT ID
const pkmn = this.pkmn;
 
// Get Pokemon Record
Severity: Minor
Found in src/app/screens/more-event-pokemon/more-event-pokemon.component.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 2 locations. Consider refactoring.
Open

get isMinEVs() {
return this.entry.hpExp == 0 &&
this.entry.attackExp == 0 &&
this.entry.defenseExp == 0 &&
this.entry.speedExp == 0 &&
Severity: Major
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts and 1 other location - About 2 hrs to fix
src/app/fragments/card-pokemon/card-pokemon.component.ts on lines 220..226

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

get isMaxEVs() {
return this.entry.hpExp == 0xFFFF &&
this.entry.attackExp == 0xFFFF &&
this.entry.defenseExp == 0xFFFF &&
this.entry.speedExp == 0xFFFF &&
Severity: Major
Found in src/app/fragments/card-pokemon/card-pokemon.component.ts and 1 other location - About 2 hrs to fix
src/app/fragments/card-pokemon/card-pokemon.component.ts on lines 237..243
Severity
Category
Status
Source
Language