Maingron/MainOS

View on GitHub

Showing 2,717 of 2,717 total issues

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

    if (setting.time.hour < 10) {
        setting.time.hour = "0" + setting.time.hour;
    }
Severity: Major
Found in scripts.js and 3 other locations - About 35 mins to fix
scripts.js on lines 350..352
scripts.js on lines 354..356
scripts.js on lines 358..360

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 46.

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 4 locations. Consider refactoring.
Open

    if (setting.time.minute < 10) {
        setting.time.minute = "0" + setting.time.minute;
    }
Severity: Major
Found in scripts.js and 3 other locations - About 35 mins to fix
scripts.js on lines 347..349
scripts.js on lines 354..356
scripts.js on lines 358..360

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 46.

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 4 locations. Consider refactoring.
Open

    if (setting.time.day < 10) {
        setting.time.day = "0" + setting.time.day;
    }
Severity: Major
Found in scripts.js and 3 other locations - About 35 mins to fix
scripts.js on lines 347..349
scripts.js on lines 350..352
scripts.js on lines 354..356

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 46.

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 4 locations. Consider refactoring.
Open

    if (setting.time.month < 10) {
        setting.time.month = "0" + setting.time.month;
    }
Severity: Major
Found in scripts.js and 3 other locations - About 35 mins to fix
scripts.js on lines 347..349
scripts.js on lines 350..352
scripts.js on lines 358..360

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 46.

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

Avoid too many return statements within this function.
Open

    return result;
Severity: Major
Found in Program Files/cmd/scripts.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return "";
    Severity: Major
    Found in Program Files/cmd/scripts.js - About 30 mins to fix

      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>
      Severity: Major
      Found in Program Files/cmd/scripts.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return "You have to activate the developer mode to enable js commands. Be careful though!";
        Severity: Major
        Found in Program Files/cmd/scripts.js - About 30 mins to fix

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

                      } else if(step[5] == "circle") {
                          paintDraw.circle(lastPosition[0], lastPosition[1], step[1], step[2], step[3], step[4], false);
                      }else if(step[5] == "circle-o") {
                          paintDraw.circle(lastPosition[0], lastPosition[1], step[1], step[2], step[3], step[4], true);
                      }
          Severity: Minor
          Found in Program Files/paint/script.js and 2 other locations - About 30 mins to fix
          Program Files/paint/script.js on lines 120..126
          Program Files/paint/script.js on lines 124..126

          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 45.

          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 3 locations. Consider refactoring.
          Open

                      }else if(step[5] == "circle-o") {
                          paintDraw.circle(lastPosition[0], lastPosition[1], step[1], step[2], step[3], step[4], true);
                      }
          Severity: Minor
          Found in Program Files/paint/script.js and 2 other locations - About 30 mins to fix
          Program Files/paint/script.js on lines 120..126
          Program Files/paint/script.js on lines 122..126

          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 45.

          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 (iofs.exists(system.user.paths.userPath + "settings/" + which.split(" ")[0] + ".txt")) {
          Severity: Minor
          Found in Program Files/cmd/scripts.js and 1 other location - About 30 mins to fix
          Program Files/cmd/scripts.js on lines 120..120

          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 45.

          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(myProgram.sandbox == 1) {
                      myWindow.classList.add("sandbox_l1");
                      myWindow.frame.sandbox = "allow-scripts allow-forms allow-pointer-lock allow-same-origin"
                  }
          Severity: Minor
          Found in functions-programs.js and 1 other location - About 30 mins to fix
          functions-programs.js on lines 102..105

          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 45.

          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

          Avoid too many return statements within this function.
          Open

                  return result;
          Severity: Major
          Found in system/iofsv2.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return "#iofs:C:/system/icons/unknown_file.svg";
            Severity: Major
            Found in Program Files/Explorer/inner/modules/load_icons.js - About 30 mins to fix

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

                          } else if(step[5] == "spherebrush-o") {
                              paintDraw.spherebrush(lastPosition[0], lastPosition[1], step[1], step[2], step[3], step[4], true);
                          } else if(step[5] == "circle") {
                              paintDraw.circle(lastPosition[0], lastPosition[1], step[1], step[2], step[3], step[4], false);
                          }else if(step[5] == "circle-o") {
              Severity: Minor
              Found in Program Files/paint/script.js and 2 other locations - About 30 mins to fix
              Program Files/paint/script.js on lines 122..126
              Program Files/paint/script.js on lines 124..126

              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 45.

              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

              Avoid too many return statements within this function.
              Open

                    return "Error: Folder already exists";
              Severity: Major
              Found in Program Files/cmd/scripts.js - About 30 mins to fix

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

                            return ("(Ancient variable, use settings menu) <br>" + which + ": " + iofs.load(system.user.paths.userPath + "settings/" + which.split(" ")[0] + ".txt"));
                Severity: Minor
                Found in Program Files/cmd/scripts.js and 1 other location - About 30 mins to fix
                Program Files/cmd/scripts.js on lines 117..117

                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 45.

                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

                Avoid too many return statements within this function.
                Open

                      return "Created folder";
                Severity: Major
                Found in Program Files/cmd/scripts.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return "'(Ancient variable, use settings menu) <br>' + Error: Setting not found";
                  Severity: Major
                  Found in Program Files/cmd/scripts.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return "'(Ancient variable, use settings menu) <br>' + changed setting - a reload may be required";
                    Severity: Major
                    Found in Program Files/cmd/scripts.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language