ocadotechnology/rapid-router

View on GitHub

Showing 697 of 1,371 total issues

File widget-scroller.js has 701 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Widget: scroller - updated 5/17/2015 (v2.22.0) *//*
 Copyright (C) 2011 T. Connell & Associates, Inc.

 Dual-licensed under the MIT and GPL licenses

Severity: Major
Found in game/static/game/js/widget-scroller.js - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

            if (params.opacity != null || 
                params["stroke-width"] != null ||
                params.fill != null ||
                params.src != null ||
                params.stroke != null ||
    Severity: Critical
    Found in game/static/game/js/raphael.js - About 1 day to fix

      Function generate_decor has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
      Open

      def generate_decor(path, num_tiles):
          DECOR_DATA = decor_data()
          DECOR_SUM = decor_sum()
      
          def find_node_by_coordinate(x, y, dec, nodes):
      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

      Function Orbit has 257 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var Orbit = function (el, settings) {
          // Don't reinitialize plugin
          if (el.hasClass(settings.slides_container_class)) {
            return this;
          }
      Severity: Major
      Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 1 day to fix

        Function setFillAndStroke has 253 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setFillAndStroke = function (o, params) {
                var node = o.node,
                    attrs = o.attrs,
                    vis = node.style.visibility;
                node.style.visibility = "hidden";
        Severity: Major
        Found in game/static/game/js/raphael.js - About 1 day to fix

          Function add_and_reorder_levels has 252 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def add_and_reorder_levels(apps, schema_editor):
          
              Level = apps.get_model("game", "Level")
              Character = apps.get_model("game", "Character")
              Theme = apps.get_model("game", "Theme")
          Severity: Major
          Found in game/migrations/0001_squashed_0025_levels_ordering_pt1.py - About 1 day 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

              File blocklyCompiler.js has 556 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              "use strict";
              
              var ocargo = ocargo || {};
              
              ocargo.BlocklyCompiler = function () {};
              Severity: Major
              Found in game/static/game/js/blocklyCompiler.js - About 1 day to fix

                Function setupTrafficLightListeners has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function setupTrafficLightListeners(trafficLight) {
                        var image = trafficLight.image;
                
                        // Position in map coordinates.
                        var sourceCoord;
                Severity: Major
                Found in game/static/game/js/level_editor.js - About 1 day to fix

                  Function setFillAndStroke has 212 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      setFillAndStroke = function (o, params) {
                          // o.paper.canvas.style.display = "none";
                          o.attrs = o.attrs || {};
                          var node = o.node,
                              a = o.attrs,
                  Severity: Major
                  Found in game/static/game/js/raphael.js - About 1 day to fix

                    Function student_row has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def student_row(levels_sorted, student, best_attempts):
                        threshold = 0.5
                    
                        num_all = num_finished = num_attempted = num_started = 0
                        total_score = 0
                    Severity: Minor
                    Found in game/views/scoreboard.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

                    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

                      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

                      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

                        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