madureira/wolfenstein

View on GitHub

Showing 33 of 55 total issues

File handlebars.runtime.js has 497 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!

 handlebars v2.0.0

Copyright (C) 2011-2014 by Yehuda Katz
Severity: Minor
Found in src/javascript/main/vendors/handlebars.runtime.js - About 7 hrs to fix

    Function __module1__ has 190 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var __module1__ = (function(__dependency1__, __dependency2__) {
      "use strict";
      var __exports__ = {};
      var Utils = __dependency1__;
      var Exception = __dependency2__;
    Severity: Major
    Found in src/javascript/main/vendors/handlebars.runtime.js - About 7 hrs to fix

      Function __module5__ has 159 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
        "use strict";
        var __exports__ = {};
        var Utils = __dependency1__;
        var Exception = __dependency2__;
      Severity: Major
      Found in src/javascript/main/vendors/handlebars.runtime.js - About 6 hrs to fix

        Function registerDefaultHelpers has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function registerDefaultHelpers(instance) {
            instance.registerHelper('helperMissing', function(/* [args, ]options */) {
              if(arguments.length === 1) {
                // A missing field in a {{foo}} constuct.
                return undefined;
        Severity: Major
        Found in src/javascript/main/vendors/handlebars.runtime.js - About 4 hrs to fix

          Function template has 109 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function template(templateSpec, env) {
              /* istanbul ignore next */
              if (!env) {
                throw new Exception("No environment passed to template");
              }
          Severity: Major
          Found in src/javascript/main/vendors/handlebars.runtime.js - About 4 hrs to fix

            Function _castSingleRay has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function _castSingleRay(screen, player, miniMap, viewDist, rayAngle, stripIdx) {
                    rayAngle = player.rot + rayAngle; // add the players viewing direction to get the angle in world space
            
                    // first make sure the angle is between 0 and 360 degrees
                    rayAngle %= twoPI;
            Severity: Major
            Found in src/javascript/main/engine/Raycasting.js - About 3 hrs to fix

              Function _renderShoot has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _renderShoot(shoot, entity, player, viewDist, screen, miniMap, gameCycleDelay, timeDelta) {
                      if (shoot === undefined) {
                          return false;
                      }
              
              
              Severity: Major
              Found in src/javascript/main/engine/GameEvents.js - About 3 hrs to fix

                Function checkCollision has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    fn.prototype.checkCollision = function(fromX, fromY, toX, toY, radius, miniMap, screen) {
                        var pos = {
                            x : fromX,
                            y : fromY
                        };
                Severity: Major
                Found in src/javascript/main/engine/Collision.js - About 3 hrs to fix

                  Function render has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      fn.prototype.render = function(player, viewDist, screen) {
                          var i = 0;
                  
                          for (i; i < this.enemiesAmount; i++) {
                              var enemy = this.enemiesList[i];
                  Severity: Major
                  Found in src/javascript/main/engine/Enemies.js - About 3 hrs to fix

                    Function keyboardMap has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        fn.prototype.keyboardMap = function(player) {
                            var self = this;
                    
                            var $selector = App.Properties.selectorEngine;
                    
                    
                    Severity: Major
                    Found in src/javascript/main/engine/Controls.js - About 2 hrs to fix

                      Function __module2__ has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var __module2__ = (function(__dependency1__) {
                        "use strict";
                        var __exports__ = {};
                        /*jshint -W004 */
                        var SafeString = __dependency1__;
                      Severity: Major
                      Found in src/javascript/main/vendors/handlebars.runtime.js - About 2 hrs to fix

                        Function _drawScreen has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _drawScreen(screen, stripIdx, dist, player, viewDist, rayAngle, wallType, textureX, level, wallIsShaded, xWallHit, yWallHit) {
                                var strip = screen.screenStrips[stripIdx];
                        
                                dist = Math.sqrt(dist);
                        
                        
                        Severity: Major
                        Found in src/javascript/main/engine/Raycasting.js - About 2 hrs to fix

                          Function onkeydown has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  document.onkeydown = function(e) {
                                      e = e || window.event;
                                      switch (e.keyCode) {
                                          case self.forwardKey[0]:
                                          case self.forwardKey[1]:
                          Severity: Minor
                          Found in src/javascript/main/engine/Controls.js - About 1 hr to fix

                            Function _drawScreen has 12 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function _drawScreen(screen, stripIdx, dist, player, viewDist, rayAngle, wallType, textureX, level, wallIsShaded, xWallHit, yWallHit) {
                            Severity: Major
                            Found in src/javascript/main/engine/Raycasting.js - About 1 hr to fix

                              Function define has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              App.define = App.define || function(clazz, namespace, object) {
                              
                                  /**
                                   * Generates an object based on array.
                                   * # Example
                              Severity: Minor
                              Found in src/javascript/main/core/package/Manager.js - About 1 hr to fix

                                Function invokePartialWrapper has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
                                Severity: Major
                                Found in src/javascript/main/vendors/handlebars.runtime.js - About 1 hr to fix

                                  Function renderObjects has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      fn.prototype.renderObjects = function(player, viewDist, screenWidth, screenHeight) {
                                          var sprite = '';
                                  
                                          for (var i=0; i < this.visibleSprites.length; i++) {
                                              sprite = this.visibleSprites[i];
                                  Severity: Minor
                                  Found in src/javascript/main/engine/Sprites.js - About 1 hr to fix

                                    Function define has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    App.define = App.define || function(clazz, namespace, object) {
                                    
                                        /**
                                         * Generates an object based on array.
                                         * # Example
                                    Severity: Minor
                                    Found in src/javascript/main/core/package/Manager.js - About 1 hr 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 _renderShoot has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        function _renderShoot(shoot, entity, player, viewDist, screen, miniMap, gameCycleDelay, timeDelta) {
                                    Severity: Major
                                    Found in src/javascript/main/engine/GameEvents.js - About 1 hr to fix

                                      Function checkCollision has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          fn.prototype.checkCollision = function(fromX, fromY, toX, toY, radius, miniMap, screen) {
                                      Severity: Major
                                      Found in src/javascript/main/engine/Collision.js - About 50 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language