Maingron/MainOS

View on GitHub

Showing 2,717 of 2,717 total issues

Function circle has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    circle: function(x, y, x2, y2, color, width, outlineOnly = false) {
Severity: Major
Found in Program Files/paint/script.js - About 50 mins to fix

    Function installExtCallback has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function installExtCallback(path, content, attributes, override, recursive, isRaw) {
    Severity: Minor
    Found in system/iofsv2-installos.js - About 45 mins to fix

      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");
      Severity: Major
      Found in Program Files/Explorer/inner/modules/file_attributes.js - About 45 mins to fix

        Function save has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            save: function(path, content, attributes = false, override = false, recursive = false, isRaw = true) {
        Severity: Minor
        Found in system/iofsv2.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      switch (setting.type.split(">")[1]) {
                          case("1"):
                              settingInput = document.createElement("h1");
                              break;
                              case("2"):
          Severity: Major
          Found in Program Files/settings/scripts.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if(steps[steps.length - 1][5] == "circle-o" && steps[steps.length - 1][0]) {
                            render();
                            steps.pop();
                        }
            Severity: Major
            Found in Program Files/paint/script.js - About 45 mins to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  ctx.mouseX = +((e.clientX - boundingClientRect.left) * (canvas.width / boundingClientRect.width)).toFixed(0);
              Severity: Minor
              Found in Program Files/paint/script.js and 1 other location - About 40 mins to fix
              Program Files/paint/script.js on lines 45..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 49.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  ctx.mouseY = +((e.clientY - boundingClientRect.top) * (canvas.height / boundingClientRect.height)).toFixed(0);
              Severity: Minor
              Found in Program Files/paint/script.js and 1 other location - About 40 mins to fix
              Program Files/paint/script.js on lines 44..44

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 49.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      const radius = Math.sqrt(Math.pow(x2 - x, 2) + Math.pow(y2 - y, 2)) / 2;
              Severity: Minor
              Found in Program Files/paint/script.js and 1 other location - About 40 mins to fix
              Program Files/paint/script.js on lines 247..247

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 48.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      const radius = Math.sqrt(Math.pow(x2 - x, 2) + Math.pow(y2 - y, 2)) / 2;
              Severity: Minor
              Found in Program Files/paint/script.js and 1 other location - About 40 mins to fix
              Program Files/paint/script.js on lines 267..267

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 48.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function dragWindow has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function dragWindow(which, x, y, offsetX = 0, offsetY = 0) {
              Severity: Minor
              Found in functions-programs.js - About 35 mins to fix

                Function rectangle has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    rectangle: function(x, y, x2, y2, color) {
                Severity: Minor
                Found in Program Files/paint/script.js - About 35 mins to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          if (whichberry.offsetTop < whichplayer.offsetTop) {
                              whichplayer.style.top = whichplayer.offsetTop - 40 + "px";
                          } else if (whichberry.offsetTop > whichplayer.offsetTop) {
                              whichplayer.style.top = whichplayer.offsetTop + 40 + "px";
                          }
                  Severity: Minor
                  Found in Program Files/Dont Tag Me/scripts.js and 1 other location - About 35 mins to fix
                  Program Files/Dont Tag Me/scripts.js on lines 126..130

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 47.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          if (whichberry.offsetLeft < whichplayer.offsetLeft) {
                              whichplayer.style.left = whichplayer.offsetLeft - 40 + "px";
                          } else if (whichberry.offsetLeft > whichplayer.offsetLeft) {
                              whichplayer.style.left = whichplayer.offsetLeft + 40 + "px";
                          }
                  Severity: Minor
                  Found in Program Files/Dont Tag Me/scripts.js and 1 other location - About 35 mins to fix
                  Program Files/Dont Tag Me/scripts.js on lines 121..125

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 47.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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("/");
                  Severity: Minor
                  Found in system/iofsv2.js - About 35 mins to fix

                  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") {
                  Severity: Minor
                  Found in Program Files/Explorer/inner/modules/load_icons.js - About 35 mins to fix

                  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 = `
                  Severity: Minor
                  Found in Program Files/taskmanager/scripts.js - About 35 mins to fix

                  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;
                  Severity: Minor
                  Found in Program Files/settings/scripts.js - About 35 mins to fix

                  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);
                          }
                  Severity: Minor
                  Found in system/iofsv2.js - About 35 mins to fix

                  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;
                      }
                  Severity: Minor
                  Found in functions-programs.js - About 35 mins to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language