Showing 14 of 21 total issues
Function applyRules
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private applyRules(): void {
const nextGeneration = new Matrix();
/**
- Read upRead up
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 addEventListener
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private addEventListener(): void {
const listen = (event: Event) => {
let target = event.target as HTMLElement;
Function gunsAndEaters
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const gunsAndEaters: SeedFunction = (gridCreator: Creator, matrix: Matrix) => {
const gunsAndEaters = readPatternFromPlainFile(gunsAndEatersPattern);
const patternGutter = 2;
Function matrixToString
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const matrixToString = (matrix: Matrix, scale = true): string => {
if(0 === matrix.getAll().length){
return 'Matrix is empty';
}
Function extractePattern
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const extractePattern = (patternPlainText: string): ExtractedPattern => {
const extractedPattern: ExtractedPattern = {
name: 'unnamed',
pattern: []
- Read upRead up
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 createGridCells
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private createGridCells(relativePointer: Position, absolutePointer: Position){
const moveRight = new Position(
1,
0
Function getNeighbours
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public getNeighbours(): Position[] {
const neighbours: Position[] = [];
// neighbours on bottom
Function matrixToString
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const matrixToString = (matrix: Matrix, scale = true): string => {
if(0 === matrix.getAll().length){
return 'Matrix is empty';
}
- Read upRead up
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 rotate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public rotate(): void {
const matrix = this.toArray();
const rotated: number[][] = [];
- Read upRead up
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 toArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public toArray(): number[][] {
const moved = new Matrix();
const moveBy = this.getMatrix().getBound().bottomLeft().inverse();
- Read upRead up
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 getSigns
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getSigns = (numberedScale: NumberedScale, i: number) =>{
if(0 === i % 5){
numberedScale.number.push(Math.abs(i).toString());
- Read upRead up
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 setCheckerboardColor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private setCheckerboardColor(): void {
const x = this.absolutePosition.x;
const y = this.absolutePosition.y;
- Read upRead up
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 createGridCells
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private createGridCells(relativePointer: Position, absolutePointer: Position){
const moveRight = new Position(
1,
0
- Read upRead up
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 readPatternFromPlainFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const readPatternFromPlainFile = (patternPlainText: string): Pattern => {
const extractedPattern = extractePattern(patternPlainText);
const matrix = new Matrix();
- Read upRead up
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"