Showing 18 of 32 total issues
Function createCore
has 265 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createCore = function () {
const core = {};
core.paused = false;
core.moduleInstances = new Map();
File saved_drawings.js
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export {
abstractLines,
snowMan,
flower,
};
File prebuilts.js
has 511 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export {blinker, glider, leightWeightSpaceShip};
const leightWeightSpaceShip = [
[
0,
1,
Function createCore
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
const createCore = function () {
const core = {};
core.paused = false;
core.moduleInstances = new Map();
- 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
File core.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @ts-check
export { createCore, ALL, ERROR, prepareWorkerCode };
export { startEventRecorder, stopEventRecorder } from "./eventRecorder.js";
export { replayEvents } from "./eventPlayer.js";
export { useDefaultLogging } from "./logging.js";
Function startUiInput
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const startUiInput = function (emitter, instance) {
let paused = false;
const pauseButton = document.getElementById(`pause`);
const pauseAction = function () {
if (paused) {
Function listenForWorkerMessage
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
listenForWorkerMessage(name, worker, resolve, earlyWrapper) {
worker.addEventListener(`message`, function (messageEvent) {
const message = messageEvent.data;
if (!Object.prototype.hasOwnProperty.call(message, CORE_ACTION_KEY)) {
return;
Function startWorker
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
startWorker(moduleUrl, name, data, workerReady) {
const earlyWrapper = {
module: moduleUrl,
name,
Function start
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
start(module, {
name = Symbol(),
data = undefined,
worker = false,
workerReady = false,
Function sumNeighbors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
const sumNeighbors = function (cells, w, h, x, y) {
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Function nextGeneration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
const nextGeneration = function (grid, neighborCounts) {
grid.forEach(function(rowArray, yIndex) {
rowArray.forEach(function(cellState, xIndex) {
// const cellState = grid[yIndex][xIndex];
const count = neighborCounts[yIndex][xIndex];
- 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"