ocadotechnology/rapid-router

View on GitHub

Showing 695 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

                        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

                            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

                              Function BlocklyCustomisations has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
                              Open

                              ocargo.BlocklyCustomisations = function () {
                              
                                  const TOOLBOX_REMAINING_CAPACITY_TEXT_COLUMN_WIDTH = 50;
                              
                                  var limitedBlocks = false;
                              Severity: Minor
                              Found in game/static/game/js/blocklyCustomisations.js - About 1 day 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 generate_random_path has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def generate_random_path(num_road_tiles, branchiness_factor, loopiness_factor, curviness_factor):
                                  def pick_adjacent_node(nodes, connections, branchiness_factor, curviness_factor):
                                      for attempts in range(5):
                                          origin = pick_origin_node(nodes, connections, branchiness_factor)
                                          possibles = []
                              Severity: Minor
                              Found in game/random_road.py - About 1 day 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

                              File dataTables.fixedColumns.js has 739 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /*! FixedColumns 3.0.4
                               * ©2010-2014 SpryMedia Ltd - datatables.net/license
                               */
                              
                              /**
                              Severity: Major
                              Found in game/static/game/js/dataTables.fixedColumns.js - About 1 day to fix

                                File foundation.joyride.js has 732 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                ;(function ($, window, document, undefined) {
                                  'use strict';
                                
                                  var Modernizr = Modernizr || false;
                                
                                
                                Severity: Major
                                Found in game/static/game/js/foundation/foundation/foundation.joyride.js - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language