ocadotechnology/rapid-router

View on GitHub

Showing 1,359 of 1,362 total issues

File codemirror.js has 6179 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
Severity: Major
Found in game/static/game/js/skulpt/codemirror.js - About 2 wks to fix

    File raphael.js has 5649 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // ┌────────────────────────────────────────────────────────────────────┐ \\
    // │ Raphaël 2.1.2 - JavaScript Vector Library                          │ \\
    // ├────────────────────────────────────────────────────────────────────┤ \\
    // │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com)    │ \\
    // │ Copyright © 2008-2012 Sencha Labs (http://sencha.com)              │ \\
    Severity: Major
    Found in game/static/game/js/raphael.js - About 2 wks to fix

      File 0001_squashed_0025_levels_ordering_pt1.py has 4781 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from __future__ import unicode_literals
      
      from builtins import range
      from django.db import models, migrations
      from django.conf import settings
      Severity: Major
      Found in game/migrations/0001_squashed_0025_levels_ordering_pt1.py - About 1 wk to fix

        Function LevelEditor has a Cognitive Complexity of 620 (exceeds 5 allowed). Consider refactoring.
        Open

        ocargo.LevelEditor = function(levelId) {
        
            /*************/
            /* Constants */
            /*************/
        Severity: Minor
        Found in game/static/game/js/level_editor.js - About 1 wk 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 LevelEditor has 2076 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ocargo.LevelEditor = function(levelId) {
        
            /*************/
            /* Constants */
            /*************/
        Severity: Major
        Found in game/static/game/js/level_editor.js - About 1 wk to fix

          File messages.py has 2124 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          from builtins import str
          
          
          def level_creation_email_subject():
              return "Custom level to moderate"
          Severity: Major
          Found in game/messages.py - About 5 days to fix

            File level_editor.js has 2104 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            var ocargo = ocargo || {};
            
            ocargo.LevelEditor = function(levelId) {
            Severity: Major
            Found in game/static/game/js/level_editor.js - About 5 days to fix

              Function Drawing has a Cognitive Complexity of 205 (exceeds 5 allowed). Consider refactoring.
              Open

              ocargo.Drawing = function (startingPosition) {
                /*************/
                /* Constants */
                /*************/
              
              
              Severity: Minor
              Found in game/static/game/js/drawing.js - About 4 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 Drawing has 803 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              ocargo.Drawing = function (startingPosition) {
                /*************/
                /* Constants */
                /*************/
              
              
              Severity: Major
              Found in game/static/game/js/drawing.js - About 4 days to fix

                Function factory has 725 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var factory = function( $, DataTable ) {
                "use strict";
                
                /**
                 * When making use of DataTables' x-axis scrolling feature, you may wish to
                Severity: Major
                Found in game/static/game/js/dataTables.fixedColumns.js - About 3 days to fix

                  File handlebars.runtime-v4.7.7.js has 1146 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**!
                  
                   @license
                   handlebars v4.7.7
                  
                  
                  Severity: Major
                  Found in game/static/game/js/handlebars.runtime-v4.7.7.js - About 2 days to fix

                    File game.js has 1131 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    'use strict'
                    
                    var ocargo = ocargo || {}
                    
                    ocargo.Game = function () {
                    Severity: Major
                    Found in game/static/game/js/game.js - About 2 days to fix

                      Function setupToolbox has 550 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function setupToolbox() {
                              var tabs = [];
                              var currentTabSelected = null;
                      
                              tabs.play = new ocargo.Tab($('#play_radio'), $("#run-code-button"), $('#play_radio + label'));
                      Severity: Major
                      Found in game/static/game/js/level_editor.js - About 2 days to fix

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

                        ocargo.Map.prototype.isRoadRight = function(position) {
                            var previousNode = position.previousNode;
                            var currentNode = position.currentNode;
                        
                            var nextCoordinates = {};
                        Severity: Major
                        Found in game/static/game/js/map.js and 1 other location - About 2 days to fix
                        game/static/game/js/map.js on lines 83..121

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

                        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.Map.prototype.isRoadLeft = function(position) {
                            var previousNode = position.previousNode;
                            var currentNode = position.currentNode;
                        
                            var nextCoordinates = {};
                        Severity: Major
                        Found in game/static/game/js/map.js and 1 other location - About 2 days to fix
                        game/static/game/js/map.js on lines 124..162

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

                        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

                        TestPlayThrough has 137 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class TestPlayThrough(BaseGameTest):
                            def setUp(self):
                                self.login_once()
                        
                            def _complete_episode(self, episode_number, level_number, **kwargs):
                        Severity: Major
                        Found in game/end_to_end_tests/test_play_through.py - About 2 days to fix

                          File drawing.js has 1018 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          'use strict'
                          
                          var ocargo = ocargo || {}
                          
                          let GRID_WIDTH = 10
                          Severity: Major
                          Found in game/static/game/js/drawing.js - About 2 days to fix

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

                                        '[{"coordinate":[1,4],"connectedNodes":[1]},'
                                        + '{"coordinate":[2,4],"connectedNodes":[0,2]},'
                                        + '{"coordinate":[2,5],"connectedNodes":[3,1]},'
                                        + '{"coordinate":[3,5],"connectedNodes":[2,4,20]},'
                                        + '{"coordinate":[4,5],"connectedNodes":[3,5]},'
                            Severity: Major
                            Found in game/migrations/0001_squashed_0025_levels_ordering_pt1.py and 1 other location - About 2 days to fix
                            game/migrations/0026_levels_pt2.py on lines 37..80

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

                            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

                                level74.path = (
                                    '[{"coordinate":[9,2],"connectedNodes":[1]},'
                                    + '{"coordinate":[8,2],"connectedNodes":[2,9,0]},'
                                    + '{"coordinate":[7,2],"connectedNodes":[1,3]},'
                                    + '{"coordinate":[7,1],"connectedNodes":[4,2]},'
                            Severity: Major
                            Found in game/migrations/0026_levels_pt2.py and 1 other location - About 2 days to fix
                            game/migrations/0001_squashed_0025_levels_ordering_pt1.py on lines 3062..3104

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

                            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 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
                              Severity
                              Category
                              Status
                              Source
                              Language