Showing 61 of 2,723 total issues
Function showDesktop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function showDesktop(state = "toggle") {
if(state == "toggle") {
for(let i = 0; i < pid.length; i++) {
if(pid[i] != "" && pid[i] != undefined) {
setWindowMinimized(getWindowById(i), true);
- 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 updatePlayer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function updatePlayer(playerID) {
var whichplayer = players[playerID];
var whichberry = berries[playerID];
if(automa) { // AI
- 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 spawnContextMenu
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function spawnContextMenu(content) { // TODO: Make async
if (document.getElementsByClassName("contextMenu")[0]) {
document.getElementsByClassName("contextMenu")[0].outerHTML = "";
}
var newelement = document.createElement("div");
- 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 loadfile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function loadfile(path,requestattributes = false) {
console.warn("IOFS1: loadfile(", path, requestattributes , ")");
const myFile = localStorage.getItem(path);
// if (localStorage.getItem(path).length < 2 || localStorage.getItem(path).indexOf("*") < 5) { // TODO: Check what this save thing does - probably can be removed
- 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 load
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
load: function(path, attributesInstead = false) {
if(!this.isAllowedPath(path)) {
return null;
}
- 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 copy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
copy: function(source, destination, override = false) {
if(!this.isAllowedPath(source) || !this.isAllowedPath(destination)) {
return false;
}
- 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
Avoid deeply nested control flow statements. Open
if(["A", "B", "C", "D", "E", "F", "0"].includes(a_attribute)) {
addColorDot(newColorDotDiv, a_attribute);
if(a_attribute == "0") {
fileElement.classList.add("system_file");
Avoid deeply nested control flow statements. Open
switch (setting.type.split(">")[1]) {
case("1"):
settingInput = document.createElement("h1");
break;
case("2"):
Function save
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
save: function(path, content, attributes = false, override = false, recursive = false) {
Function dragWindow
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function dragWindow(which, x, y, offsetX = 0, offsetY = 0) {
Function getPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getPath: function(path) {
path = this.sanitizePath(path);
var goUpCount = 0;
let pathArray = path.split("/");
- 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 returnPathForFileIcon
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function returnPathForFileIcon(path) {
let filename = iofs.getName(path);
var fileending = filename.slice(filename.lastIndexOf("."));
if(iofs.typeof(path) == "dir") {
- 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 refreshTaskList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function refreshTaskList() {
if(pids.toString() != pidsPrevious.toString()) { // If the task list has changed
pidsPrevious = pids.slice();
tasklist.innerHTML = `
- 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 createCategories
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function createCategories() {
for(category of settings) {
var categoryElement = document.createElement("div");
categoryElement.className = "category";
categoryElement.id = category.id;
- 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 sanitizePath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
sanitizePath: function(path) {
path = path.replaceAll("//", "/");
if(path.indexOf("//") >= 0) {
path = this.sanitizePath(path);
}
- 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 focusWindow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function focusWindow(which, state) {
if(state == false || which == false) {
unfocus();
return;
}
- 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
Avoid too many return
statements within this function. Open
return JSON.parse(iofs.load(path)).icon;
Avoid too many return
statements within this function. Open
return "You have to activate the developer mode to enable js commands. Be careful though!";
Avoid too many return
statements within this function. Open
return "";
Avoid too many return
statements within this function. Open
return /*html*/ `
<b class='helpb' style='font-weight:inherit'><b>cls</b> clears console<br>
<b>echo <a>[Message]</a></b> well, it's echo...<br>
<b>run <b>[name of program]</b></b> opens a program<br>
<b>close <b>[pid of program]</b></b> closes a program<br>