Maingron/MaingronZelda

View on GitHub
levels.js

Summary

Maintainability
F
2 wks
Test Coverage

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;
Severity: Major
Found in levels.js - About 5 days to fix

    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
    Severity: Major
    Found in levels.js - About 2 days to fix

      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;
      Severity: Minor
      Found in levels.js - About 2 days 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 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
      Severity: Minor
      Found in levels.js - About 3 hrs 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 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
      Severity: Minor
      Found in levels.js - About 1 hr to fix

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

        function createRoom(x,y, type, buildTop = 1, buildRight = 1, buildBottom = 1, buildLeft = 1) {
        Severity: Major
        Found in levels.js - About 50 mins to fix

          Avoid deeply nested control flow statements.
          Open

              } else if (level.indexOf("006") >= 0) { //Level 6 - Dungeon 1
                  summonElement("runner", objects.field, 100, 198);
                  data.runner.position.top = 198;
                  data.runner.position.left = 100;
          
          
          Severity: Major
          Found in levels.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if(loadState("colormode") != "1") {
                            summonElement("button1-1", objects.field, 4, 1);
                        } else {
                            summonElement("button1-2", objects.field, 4, 1);
                        }
            Severity: Major
            Found in levels.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                      } else if (level == "004-3") { // Pause menu
                          loadLevel("004");
              
                      } else if (level == "004-4") { // Level Selection
                          summonElement("textbox", objects.field, 0, 0, lang.back);
              Severity: Major
              Found in levels.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if(loadState("music") != "false") {
                                summonElement("button1-2", objects.field, 4, 2);
                            } else {
                                summonElement("button1-1", objects.field, 4, 2);
                            }
                Severity: Major
                Found in levels.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                          for (data.temp.iOfLG = 1; data.temp.iOfLG < 11; data.temp.iOfLG++) {
                              data.walls.push("type1-8,0," + data.temp.iOfLG);
                              data.walls.push("type1-4,29," + data.temp.iOfLG);
                  
                          }
                  Severity: Major
                  Found in levels.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                            for (data.temp.iOfLG = 1; data.temp.iOfLG < 29; data.temp.iOfLG++) {
                                data.walls.push("type1-2," + data.temp.iOfLG + ",0");
                                if (data.temp.iOfLG != 15) {
                                    data.walls.push("type1-6," + data.temp.iOfLG + ",11");
                                }
                    Severity: Major
                    Found in levels.js - About 45 mins to fix

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

                              for (data.temp.iOfLG = 36; data.temp.iOfLG >= 32; data.temp.iOfLG--) {
                                  data.walls.push("type2-2," + data.temp.iOfLG + ",34");
                              }
                      Severity: Major
                      Found in levels.js and 2 other locations - About 2 hrs to fix
                      levels.js on lines 103..105
                      levels.js on lines 410..412

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

                      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

                              for (data.temp.iOfLG = 58; data.temp.iOfLG <= 65; data.temp.iOfLG++) {
                                  data.walls.push("type2-2," + data.temp.iOfLG + ",34");
                              }
                      Severity: Major
                      Found in levels.js and 2 other locations - About 2 hrs to fix
                      levels.js on lines 103..105
                      levels.js on lines 343..345

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

                      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(buildBottom == 1) {
                                  data.walls.push("type3-10, "+(x+8)+","+(y + 10));
                                  data.walls.push("type3-9, "+(x+10)+","+(y + 10));
                                  // summonElement("floor3-1", "", (x+9), (y + 10));
                              }
                      Severity: Major
                      Found in levels.js and 1 other location - About 2 hrs to fix
                      levels.js on lines 53..57

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

                      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(buildRight == 1) {
                                  data.walls.push("type3-12, "+(x+18)+","+(y+4));
                                  data.walls.push("type3-9, "+(x+18)+","+(y+6));
                                  // summonElement("floor3-1", "", (x+18), (y + 5));
                              }
                      Severity: Major
                      Found in levels.js and 1 other location - About 2 hrs to fix
                      levels.js on lines 67..71

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

                      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

                              for (data.temp.iOfLG = 1; data.temp.iOfLG < 17; data.temp.iOfLG++) {
                                  data.walls.push("type1-2," + data.temp.iOfLG + ",0");
                              }
                      Severity: Major
                      Found in levels.js and 2 other locations - About 2 hrs to fix
                      levels.js on lines 343..345
                      levels.js on lines 410..412

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

                      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

                              for (data.temp.iOfLG = 1; data.temp.iOfLG < 11; data.temp.iOfLG++) {
                                  data.walls.push("type1-8,0," + data.temp.iOfLG);
                              }
                      Severity: Major
                      Found in levels.js and 1 other location - About 1 hr to fix
                      levels.js on lines 117..119

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

                      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

                              for (data.temp.iOfLG = 1; data.temp.iOfLG < 11; data.temp.iOfLG++) {
                                  data.walls.push("type1-4,17," + data.temp.iOfLG);
                              }
                      Severity: Major
                      Found in levels.js and 1 other location - About 1 hr to fix
                      levels.js on lines 113..115

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

                      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 (level.split("002-")[1] == "1") {
                                  summonElement("runner", objects.field, 3, 7);
                                  data.runner.position.left = 57;
                                  data.runner.position.top = 22;
                      
                      
                      Severity: Major
                      Found in levels.js and 1 other location - About 1 hr to fix
                      levels.js on lines 185..193

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

                      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

                              } else if (level.split("002-")[1] == "3") {
                                  summonElement("runner", objects.field, 64, 22);
                                  data.runner.position.left = 64;
                                  data.runner.position.top = 22;
                      
                      
                      Severity: Major
                      Found in levels.js and 1 other location - About 1 hr to fix
                      levels.js on lines 180..193

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

                      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

                      for(var x=92;x<95;x++) {
                          for(var y=146;y<=154;y++) {
                              summonElement("hole", "", x,y);
                          }
                      }
                      Severity: Major
                      Found in levels.js and 1 other location - About 1 hr to fix
                      levels.js on lines 1424..1428

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

                      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

                      for(var x=144;x<=146;x++) {
                          for(var y=146;y<=154;y++) {
                              summonElement("hole", "", x,y);
                          }
                      }
                      Severity: Major
                      Found in levels.js and 1 other location - About 1 hr to fix
                      levels.js on lines 1357..1361

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

                      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 (data.temp.iOfLG != 11) {
                                      data.walls.push("type1-6," + data.temp.iOfLG + ",11");
                                  }
                      Severity: Minor
                      Found in levels.js and 1 other location - About 45 mins to fix
                      levels.js on lines 725..727

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

                      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 (data.temp.iOfLG != 15) {
                                      data.walls.push("type1-6," + data.temp.iOfLG + ",11");
                                  }
                      Severity: Minor
                      Found in levels.js and 1 other location - About 45 mins to fix
                      levels.js on lines 108..110

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

                      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(loadState("music") != "false") {
                                      summonElement("button1-2", objects.field, 4, 2);
                                  } else {
                                      summonElement("button1-1", objects.field, 4, 2);
                                  }
                      Severity: Minor
                      Found in levels.js and 1 other location - About 35 mins to fix
                      levels.js on lines 662..666

                      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(loadState("colormode") != "1") {
                                      summonElement("button1-1", objects.field, 4, 1);
                                  } else {
                                      summonElement("button1-2", objects.field, 4, 1);
                                  }
                      Severity: Minor
                      Found in levels.js and 1 other location - About 35 mins to fix
                      levels.js on lines 672..676

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

                      for(var x=129;x<=143;x++) {
                              data.enemys.push("hole,"+x+",147");
                      }
                      Severity: Minor
                      Found in levels.js and 2 other locations - About 35 mins to fix
                      levels.js on lines 1560..1562
                      levels.js on lines 1565..1567

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

                              for(var x=6;x<12;x++) {
                                  data.walls.push("type2-26,"+x+",4");
                              }
                      Severity: Minor
                      Found in levels.js and 2 other locations - About 35 mins to fix
                      levels.js on lines 1416..1418
                      levels.js on lines 1560..1562

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

                              for(var x=13;x<21;x++) {
                                  data.walls.push("type2-26,"+x+",3");
                              }
                      Severity: Minor
                      Found in levels.js and 2 other locations - About 35 mins to fix
                      levels.js on lines 1416..1418
                      levels.js on lines 1565..1567

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

                                  if (data.temp.iOfLG != 88 && data.temp.iOfLG != 87 && data.temp.iOfLG != 100 && data.temp.iOfLG != 113 && data.temp.iOfLG != 114) {
                      Severity: Minor
                      Found in levels.js and 1 other location - About 30 mins to fix
                      levels.js on lines 777..777

                      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 (data.temp.iOfLG != 191 && data.temp.iOfLG != 192 && data.temp.iOfLG != 193) {
                      Severity: Minor
                      Found in levels.js and 1 other location - About 30 mins to fix
                      levels.js on lines 756..756

                      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

                      There are no issues that match your filters.

                      Category
                      Status