ocadotechnology/rapid-router

View on GitHub
game/static/game/js/blocklyCustomBlocks.js

Summary

Maintainability
F
2 wks
Test Coverage

Function initCustomBlocksDescription has 441 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function initCustomBlocksDescription() {
  Blockly.Blocks["start"] = {
    // Beginning block - identifies the start of the program
    init: function () {
      ocargo.blocklyControl.numStartBlocks++;
Severity: Major
Found in game/static/game/js/blocklyCustomBlocks.js - About 2 days to fix

    File blocklyCustomBlocks.js has 560 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    var ocargo = ocargo || {};
    var Blockly = Blockly || {};
    
    
    Severity: Major
    Found in game/static/game/js/blocklyCustomBlocks.js - About 1 day to fix

      Function initCustomBlocksPython has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function initCustomBlocksPython() {
        Blockly.Python["start"] = function (block) {
          return "";
        };
      
      
      Severity: Major
      Found in game/static/game/js/blocklyCustomBlocks.js - About 4 hrs to fix

        Function init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            init: function () {
              this.setColour(260);
              var dropdown = new Blockly.FieldDropdown(
                [
                  [gettext("white"), ocargo.Cow.WHITE],
        Severity: Minor
        Found in game/static/game/js/blocklyCustomBlocks.js - About 1 hr to fix

          Function initCustomBlocksDescription has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function initCustomBlocksDescription() {
            Blockly.Blocks["start"] = {
              // Beginning block - identifies the start of the program
              init: function () {
                ocargo.blocklyControl.numStartBlocks++;
          Severity: Minor
          Found in game/static/game/js/blocklyCustomBlocks.js - About 25 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

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

            Blockly.Blocks["turn_around"] = {
              // Block for turning around
              init: function () {
                this.setColour(160);
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 4 other locations - About 7 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 56..80
          game/static/game/js/blocklyCustomBlocks.js on lines 82..106
          game/static/game/js/blocklyCustomBlocks.js on lines 134..158
          game/static/game/js/blocklyCustomBlocks.js on lines 160..184

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

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

            Blockly.Blocks["deliver"] = {
              // Block for delivering (only on levels with multiple destinations)
              init: function () {
                this.setColour(160);
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 4 other locations - About 7 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 56..80
          game/static/game/js/blocklyCustomBlocks.js on lines 82..106
          game/static/game/js/blocklyCustomBlocks.js on lines 108..132
          game/static/game/js/blocklyCustomBlocks.js on lines 134..158

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

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

            Blockly.Blocks["turn_left"] = {
              // Block for turning left
              init: function () {
                this.setColour(160);
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 4 other locations - About 7 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 82..106
          game/static/game/js/blocklyCustomBlocks.js on lines 108..132
          game/static/game/js/blocklyCustomBlocks.js on lines 134..158
          game/static/game/js/blocklyCustomBlocks.js on lines 160..184

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

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

            Blockly.Blocks["turn_right"] = {
              // Block for turning right
              init: function () {
                this.setColour(160);
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 4 other locations - About 7 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 56..80
          game/static/game/js/blocklyCustomBlocks.js on lines 108..132
          game/static/game/js/blocklyCustomBlocks.js on lines 134..158
          game/static/game/js/blocklyCustomBlocks.js on lines 160..184

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

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

            Blockly.Blocks["wait"] = {
              // Block for not moving the van for a time
              init: function () {
                this.setColour(160);
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 4 other locations - About 7 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 56..80
          game/static/game/js/blocklyCustomBlocks.js on lines 82..106
          game/static/game/js/blocklyCustomBlocks.js on lines 108..132
          game/static/game/js/blocklyCustomBlocks.js on lines 160..184

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

          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

            Blockly.Blocks["variables_increment"] = {
              init: function () {
                this.appendDummyInput()
                  .appendField(Blockly.Msg.VARIABLES_INCREMENT_TITLE)
                  .appendField(new Blockly.FieldTextInput(""), "NAME")
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 6 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 437..449

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

          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

            Blockly.Blocks["variables_numeric_set"] = {
              init: function () {
                this.appendDummyInput()
                  .appendField(Blockly.Msg.VARIABLES_SET_TITLE)
                  .appendField(new Blockly.FieldTextInput(""), "NAME")
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 6 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 451..463

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

          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

            Blockly.Blocks["controls_repeat_while"] = {
              // Block for repeat while
              init: function () {
                this.setColour(120);
                this.appendValueInput("condition")
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 5 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 391..405

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

          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

            Blockly.Blocks["controls_repeat_until"] = {
              // Block for repeat until
              init: function () {
                this.setColour(120);
                this.appendValueInput("condition")
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 5 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 375..389

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

          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

            Blockly.Blocks["at_destination"] = {
              init: function () {
                this.setColour(210);
                this.setOutput(true, "Boolean");
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 4 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 248..262

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

          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

            Blockly.Blocks["dead_end"] = {
              init: function () {
                this.setColour(210);
                this.setOutput(true, "Boolean");
                this.appendDummyInput()
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 4 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 264..278

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

          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

            Blockly.Python["controls_repeat_until"] = function (block) {
              var condition = Blockly.Python.valueToCode(
                block,
                "condition",
                Blockly.Python.ORDER_ATOMIC
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 2 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 612..621

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

          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

            Blockly.Python["controls_repeat_while"] = function (block) {
              var condition = Blockly.Python.valueToCode(
                block,
                "condition",
                Blockly.Python.ORDER_ATOMIC
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 2 hrs to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 623..632

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

          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

                this.appendDummyInput()
                  .appendField(new Blockly.FieldDropdown(BOOLEANS), "CHOICE")
                  .appendField(
                    new Blockly.FieldImage(
                      ocargo.Drawing.imageDir + "empty.svg",
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 1 hr to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 216..224

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

          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

                this.appendDummyInput()
                  .appendField(new Blockly.FieldDropdown(BOOLEANS), "CHOICE")
                  .appendField(
                    new Blockly.FieldImage(
                      ocargo.Drawing.imageDir + "empty.svg",
          Severity: Major
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 1 hr to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 236..244

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

          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

                this.appendDummyInput("Event")
                  .appendField(gettext("On "))
                  .appendField(dropdown, "TYPE")
                  .appendField(
                    new Blockly.FieldImage(
          Severity: Minor
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 40 mins to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 284..288

          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

                      this.appendDummyInput()
                          .appendField(Blockly.Msg.COW_CROSSING_TITLE)
                          .appendField(new Blockly.FieldImage(ocargo.Drawing.imageDir + ocargo.Drawing.whiteCowUrl,
                              ocargo.BlocklyControl.COW_WIDTH,
                              ocargo.BlocklyControl.BLOCK_HEIGHT), 'IMAGE');
          Severity: Minor
          Found in game/static/game/js/blocklyCustomBlocks.js and 1 other location - About 40 mins to fix
          game/static/game/js/blocklyCustomBlocks.js on lines 351..361

          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

          There are no issues that match your filters.

          Category
          Status