Showing 41 of 130 total issues
Function loadLevel
has 1023 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadLevel(level = pData.level) {
pData.level = level;
init();
data.runner.inmenu = 0;
Function doEnemyTick
has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring. Open
function doEnemyTick() {
data.temp.slicernr = 0;
for (data.temp.iOfEnemyTick = 0; data.enemys.length > data.temp.iOfEnemyTick; data.temp.iOfEnemyTick++) {
if (data.enemys[data.temp.iOfEnemyTick][0] == "spikes") {
- 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 levels.js
has 1073 lines of code (exceeds 250 allowed). Consider refactoring. Open
function createRoom(x,y, type, buildTop = 1, buildRight = 1, buildBottom = 1, buildLeft = 1) {
// Build** == 0: Don't spawn walls on that side
// Build** == 1: Spawn walls on that side + leave space for door
// TODO Build** == 2: Spawn walls on that side and block walls
// TODO Build** == 3: Spawn fully wall-filled room
Function loadLevel
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
function loadLevel(level = pData.level) {
pData.level = level;
init();
data.runner.inmenu = 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
File scripts.js
has 920 lines of code (exceeds 250 allowed). Consider refactoring. Open
var pData = { // pData means permanent Data like saves
"runner": {},
"leveldata": {}
};
Function init2
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
function init2() {
for (data.iOfInit2 = 0; data.walls.length > data.iOfInit2; data.iOfInit2++) {
data.temp.setWalls = [];
data.temp.setWalls[data.iOfInit2] = data.walls[data.iOfInit2].split(",");
summonElement("wall", objects.field, +data.temp.setWalls[data.iOfInit2][1], +data.temp.setWalls[data.iOfInit2][2]);
- 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 doTick
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
function doTick() {
if (!data.runner.inmenu) {
data.runner.oldposition.top = data.runner.position.top;
data.runner.oldposition.left = data.runner.position.left;
- 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 doMove
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doMove() {
if (data.runner.position.top <= 0) {
data.runner.cango.up = !1;
} else if (data.runner.position.top >= data.field.height - 1) {
Function doEnemyTick
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doEnemyTick() {
data.temp.slicernr = 0;
for (data.temp.iOfEnemyTick = 0; data.enemys.length > data.temp.iOfEnemyTick; data.temp.iOfEnemyTick++) {
if (data.enemys[data.temp.iOfEnemyTick][0] == "spikes") {
Function doTick
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doTick() {
if (!data.runner.inmenu) {
data.runner.oldposition.top = data.runner.position.top;
data.runner.oldposition.left = data.runner.position.left;
Function createRoom
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function createRoom(x,y, type, buildTop = 1, buildRight = 1, buildBottom = 1, buildLeft = 1) {
// Build** == 0: Don't spawn walls on that side
// Build** == 1: Spawn walls on that side + leave space for door
// TODO Build** == 2: Spawn walls on that side and block walls
// TODO Build** == 3: Spawn fully wall-filled room
- 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 init2
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init2() {
for (data.iOfInit2 = 0; data.walls.length > data.iOfInit2; data.iOfInit2++) {
data.temp.setWalls = [];
data.temp.setWalls[data.iOfInit2] = data.walls[data.iOfInit2].split(",");
summonElement("wall", objects.field, +data.temp.setWalls[data.iOfInit2][1], +data.temp.setWalls[data.iOfInit2][2]);
Function doInMenuTick
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function doInMenuTick() {
if (data.runner.inmenu == true) {
data.temp.menuGoBack = 0;
data.runner.cango.down = 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
File midiplayer.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
var midiPlayer = {};
function extend(a, b){
for(var key in b)
Function init
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init() {
if (objects.field) {
objects.field.innerHTML = "";
objects.field.outerHTML = "";
}
Function destroyElement
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function destroyElement(x, y, type) {
for (var i = 0; i < data.allthings.length; i++) {
if (data.allthings[i][0] == "trigger") {
console.log(data.allthings[i]);
}
- 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 createRoom
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createRoom(x,y, type, buildTop = 1, buildRight = 1, buildBottom = 1, buildLeft = 1) {
// Build** == 0: Don't spawn walls on that side
// Build** == 1: Spawn walls on that side + leave space for door
// TODO Build** == 2: Spawn walls on that side and block walls
// TODO Build** == 3: Spawn fully wall-filled room
Function summonElement
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function summonElement(classname, childof, x = 0, y = 0, triggerdo) {
if(classname == "runner") {
if(document.getElementsByClassName("runner")[0]) {
document.getElementsByClassName("runner")[0].outerHTML = "";
}
- 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 summonElement
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function summonElement(classname, childof, x = 0, y = 0, triggerdo) {
if(classname == "runner") {
if(document.getElementsByClassName("runner")[0]) {
document.getElementsByClassName("runner")[0].outerHTML = "";
}
Function doInMenuTick
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doInMenuTick() {
if (data.runner.inmenu == true) {
data.temp.menuGoBack = 0;
data.runner.cango.down = 0;