Showing 58 of 2,664 total issues
CardPokemonComponent
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'card-pokemon',
templateUrl: './card-pokemon.component.pug',
styleUrls: ['./card-pokemon.component.scss'],
})
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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';
- Create a ticketCreate a ticket
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)
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
SaveFileIterator
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
export class SaveFileIterator {
constructor(saveFile: any) {
this.saveFile = saveFile;
this.state = [];
}
- Create a ticketCreate a ticket
SaveFileService
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable({
providedIn: 'root'
})
export class SaveFileService {
- Create a ticketCreate a ticket
StorageAllComponent
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'screen-storage-all',
templateUrl: './storage-all.component.pug',
styleUrls: ['./storage-all.component.scss'],
})
- Create a ticketCreate a ticket
Function _rebuildMenu
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
_rebuildMenu(arr) {
for (var i = 0; i < arr.length; i++) {
const obj = arr[i];
// Is not designated platform
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function movesList
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
get movesList() {
// Gather applicable Learnset (If Any)
let learnset = [];
if(this.pokemonData !== undefined && this.pokemonData.initial !== undefined)
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function convertEngToHTML
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public convertEngToHTML(msg: string, maxChars: number, rival: string = "BLUE", player: string = "RED") {
// Convert string to char codes
let charCodes = Array.from(this.convertToCode(msg, maxChars, false));
// Pre-pass
- Create a ticketCreate a ticket
Function genPokemonAndGive
has 55 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
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) {
- Create a ticketCreate a ticket
Function convertEngToHTML
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public convertEngToHTML(msg: string, maxChars: number, rival: string = "BLUE", player: string = "RED") {
// Convert string to char codes
let charCodes = Array.from(this.convertToCode(msg, maxChars, false));
// Pre-pass
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function save
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public save(saveFile: SaveFileService,
startOffset: number,
speciesStartOffset: number | null,
nicknameStartOffset: number,
otNameStartOffset: number,
- Create a ticketCreate a ticket
Function movesList
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
get movesList() {
// Gather applicable Learnset (If Any)
let learnset = [];
if(this.pokemonData !== undefined && this.pokemonData.initial !== undefined)
- Create a ticketCreate a ticket
Function load
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public load(saveFile: SaveFileService) {
this.pauseWildEncounters3Steps = saveFile.getBit(0x29D8, 1, 0);
this.grassRate = saveFile.getByte(0x2B33);
// Load Grass Pokemon only if there's an encounter rate for it
- Create a ticketCreate a ticket
Function mapList
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
get mapList() {
const maps: Map[] = this.gd.file("maps").data;
const b = (val: number | any) => {
- Create a ticketCreate a ticket
Function newPokemon
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static newPokemon(file: SaveFileService, pdb: PokemonDBService, gd: GameDataService) {
const pkmn = new PokemonBox();
const pkmnList = gd.file("randomPkmn").data;
const pkmnData = pdb.pokemon[_.snakeCase(pkmnList[_.random(0, pkmnList.length, false)])];
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onSpeciesChange
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public onSpeciesChange() {
this.updateData();
const species = this.pdb.pokemon[this.entry.species];
if(species == undefined || species.name == undefined)
- Create a ticketCreate a ticket