ocadotechnology/rapid-router

View on GitHub

Showing 1,368 of 1,371 total issues

Function add_levels has 203 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def add_levels(apps, schema_editor):

    Level = apps.get_model("game", "Level")
    Theme = apps.get_model("game", "Theme")
    Character = apps.get_model("game", "Character")
Severity: Major
Found in game/migrations/0001_squashed_0025_levels_ordering_pt1.py - About 1 day to fix

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

    Severity: Major
    Found in game/migrations/0064_character_name_data.py and 1 other location - About 1 day to fix
    game/migrations/0059_theme_name_data.py on lines 0..25

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

    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

    Severity: Major
    Found in game/migrations/0059_theme_name_data.py and 1 other location - About 1 day to fix
    game/migrations/0064_character_name_data.py on lines 0..25

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

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

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

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

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

    Refactorings

    Further Reading

    Function performAnimation has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

    ocargo.Animation.prototype.performAnimation = function(animation) {
        // Duration is either custom set (for each element) or generic
        var duration = animation.animationLength || this.animationDuration;
    
        switch (animation.type) {
    Severity: Minor
    Found in game/static/game/js/animation.js - About 7 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

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

    ocargo.Game.prototype.onSlowControls = function () {
      this.disallowCodeChanges()
    
      document.getElementById('direct_drive').style.visibility = 'hidden'
    
    
    Severity: Major
    Found in game/static/game/js/game.js and 1 other location - About 7 hrs to fix
    game/static/game/js/game.js on lines 576..590

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

    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

    ocargo.Game.prototype.onFastControls = function () {
      this.disallowCodeChanges()
    
      document.getElementById('direct_drive').style.visibility = 'hidden'
    
    
    Severity: Major
    Found in game/static/game/js/game.js and 1 other location - About 7 hrs to fix
    game/static/game/js/game.js on lines 592..606

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

    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_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

    File model.js has 493 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    var ocargo = ocargo || {};
    
    ocargo.Model = function(nodeData, origin, destinations, trafficLightData, cowData, maxFuel) {
    Severity: Minor
    Found in game/static/game/js/model.js - About 7 hrs to fix

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

      ocargo.BlocklyCompiler.prototype.createWhileUntil = function (block) {
        var conditionBlock = block.inputList[0].connection.targetBlock();
        if (conditionBlock === null) {
          throw gettext_noop("Perhaps try looking at your 'repeat' blocks?");
        }
      Severity: Major
      Found in game/static/game/js/blocklyCompiler.js and 1 other location - About 7 hrs to fix
      game/static/game/js/blocklyCompiler.js on lines 580..595

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

      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

      ocargo.BlocklyCompiler.prototype.mobileCreateWhileUntil = function (block) {
        var conditionBlock = block.inputList[0].connection.targetBlock();
        if (conditionBlock === null) {
          throw gettext_noop("Perhaps try looking at your 'repeat' blocks?");
        }
      Severity: Major
      Found in game/static/game/js/blocklyCompiler.js and 1 other location - About 7 hrs to fix
      game/static/game/js/blocklyCompiler.js on lines 213..228

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

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

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

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

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

      Refactorings

      Further Reading

      Function runAnimation has 194 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function runAnimation(anim, element, percent, status, totalOrigin, times) {
              percent = toFloat(percent);
              var params,
                  isInAnim,
                  isInAnimSet,
      Severity: Major
      Found in game/static/game/js/raphael.js - About 7 hrs to fix

        Function BlocklyCustomisations has 192 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ocargo.BlocklyCustomisations = function () {
        
            const TOOLBOX_REMAINING_CAPACITY_TEXT_COLUMN_WIDTH = 50;
            const QUANTITY_TEXT_OFFSET = 35;
        
        
        Severity: Major
        Found in game/static/game/js/blocklyCustomisations.js - About 7 hrs to fix

          File en-gb.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // This file was automatically generated.  Do not modify.
          
          'use strict';
          
          goog.provide('Blockly.Msg.en.gb');
          Severity: Minor
          Found in game/static/game/js/blockly/msg/js/en-gb.js - About 7 hrs to fix

            File hi.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // This file was automatically generated.  Do not modify.
            
            'use strict';
            
            goog.provide('Blockly.Msg.hi');
            Severity: Minor
            Found in game/static/game/js/blockly/msg/js/hi.js - About 7 hrs to fix

              File fr.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // This file was automatically generated.  Do not modify.
              
              'use strict';
              
              goog.provide('Blockly.Msg.fr');
              Severity: Minor
              Found in game/static/game/js/blockly/msg/js/fr.js - About 7 hrs to fix

                File en.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // This file was automatically generated.  Do not modify.
                
                'use strict';
                
                goog.provide('Blockly.Msg.en');
                Severity: Minor
                Found in game/static/game/js/blockly/msg/js/en.js - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language