Showing 68 of 2,717 total issues
File functions-programs.js
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
function getProcessList() {
return(processList);
}
function newProcessListEntry(programIdentifier) {
Function runcmd
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function runcmd(which) {
if (which.indexOf("md:") != 1) {
return "error";
}
- 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 iofsv2.js
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
var ismainos = 1;
var iofs = {
forbiddenCharsInPath: ['*', '?', '#', '$', '\'', '"', '`', '\\', '§', ','],
Function run
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function run(which, iattr, how) { // Run a program
let myPid = newProcessListEntry(which);
let myProgram = system.user.programs[which];
if(!checkMayStillOpen(which) || myProgram.disabled) {
processList[myPid] = 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 loadProgramMetadata
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function loadProgramMetadata(which) { // Load program metadata from program file and handle some other stuff
if(typeof(which) == "string") {
which = system.user.programs[which];
}
- 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 applyFileAttributesToAll
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function applyFileAttributesToAll() {
for(fileElement of document.getElementById("content_files").children) {
// if file name starts with ., add class hidden
if(fileElement.innerText.startsWith(".")) {
fileElement.classList.add("fattr-hidden");
- 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 applySettingsToCategory
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function applySettingsToCategory(categoryName) {
var category = settings.find(category => category.id == categoryName);
for(setting of category.settings) {
var settingElement = document.createElement("div");
settingElement.className = "setting";
- 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 random
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function random(min, max, decimals, runs) { // Deprecated
// Todo: Fix following limits:
// min has to be at least 0 (no negative possible)
// limited to digits of Math.random(), other digits will be 0
// runs only runs Math.random() a defined amount of times before the final result is generated and returned. Instead previous values should be used as some sort of seed to improve randomisation
- 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 onload
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
window.onload = function(){
// Check Disk size
if (localStorage && !localStorage.getItem('size')) {
let i = 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 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
var objects = {};
var register = [];
var program = {};
var processList = pid = [];
if(typeof(setting) != "object") {
Function doThisOnMouseMove
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
async function doThisOnMouseMove(e) {
let boundingClientRect = canvas.getBoundingClientRect()
ctx.mouseX = +((e.clientX - boundingClientRect.left) * (canvas.width / boundingClientRect.width)).toFixed(0);
ctx.mouseY = +((e.clientY - boundingClientRect.top) * (canvas.height / boundingClientRect.height)).toFixed(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 script.js
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
var path = window.parent.attr;
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
Function getInfos
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
getInfos(path) {
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 Taskbar
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function Taskbar() {
this.htmlElement = document.getElementById("taskbar");
this.tasklist = document.getElementById("tasklist");
- 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 listdir
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
listdir: function(path, recurseDepth = 0) {
path = this.sanitizePath(path);
if(path == "/") {
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 save
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
save: function(path, content, attributes = false, override = false, recursive = false, isRaw = true) {
path = this.sanitizePath(path);
if(!this.isAllowedPath(path)) {
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
Function delete
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
delete: function(path, recursive = false) {
path = this.sanitizePath(path);
if(!this.exists(path)) {
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
Function render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function render(event) {
if(!lastRenderComplete) {
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
Function load
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
load: function(path, raw = 1) {
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 explorerdo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function explorerdo(path, action = "default") { // Shows directory or does stuff asigned to files / file types
if(path == "..") { // If want to go up a directory
path = iofs.getPath(currentPath);
if(currentPath.slice(-2) == ":/") { // Make sure to be able to display rootdir again
- 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"