Showing 33 of 55 total issues
File handlebars.runtime.js
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
handlebars v2.0.0
Copyright (C) 2011-2014 by Yehuda Katz
Function __module1__
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __module1__ = (function(__dependency1__, __dependency2__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
Function __module5__
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
Function registerDefaultHelpers
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(/* [args, ]options */) {
if(arguments.length === 1) {
// A missing field in a {{foo}} constuct.
return undefined;
Function template
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function template(templateSpec, env) {
/* istanbul ignore next */
if (!env) {
throw new Exception("No environment passed to template");
}
Function _castSingleRay
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function _renderShoot
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _renderShoot(shoot, entity, player, viewDist, screen, miniMap, gameCycleDelay, timeDelta) {
if (shoot === undefined) {
return false;
}
Function checkCollision
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.prototype.checkCollision = function(fromX, fromY, toX, toY, radius, miniMap, screen) {
var pos = {
x : fromX,
y : fromY
};
Function render
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.prototype.render = function(player, viewDist, screen) {
var i = 0;
for (i; i < this.enemiesAmount; i++) {
var enemy = this.enemiesList[i];
Function keyboardMap
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.prototype.keyboardMap = function(player) {
var self = this;
var $selector = App.Properties.selectorEngine;
Function __module2__
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __module2__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
/*jshint -W004 */
var SafeString = __dependency1__;
Function _drawScreen
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _drawScreen(screen, stripIdx, dist, player, viewDist, rayAngle, wallType, textureX, level, wallIsShaded, xWallHit, yWallHit) {
var strip = screen.screenStrips[stripIdx];
dist = Math.sqrt(dist);
Function onkeydown
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
document.onkeydown = function(e) {
e = e || window.event;
switch (e.keyCode) {
case self.forwardKey[0]:
case self.forwardKey[1]:
Function _drawScreen
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _drawScreen(screen, stripIdx, dist, player, viewDist, rayAngle, wallType, textureX, level, wallIsShaded, xWallHit, yWallHit) {
Function define
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
App.define = App.define || function(clazz, namespace, object) {
/**
* Generates an object based on array.
* # Example
Function invokePartialWrapper
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
Function renderObjects
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.prototype.renderObjects = function(player, viewDist, screenWidth, screenHeight) {
var sprite = '';
for (var i=0; i < this.visibleSprites.length; i++) {
sprite = this.visibleSprites[i];
Function define
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
App.define = App.define || function(clazz, namespace, object) {
/**
* Generates an object based on array.
* # Example
- Read upRead up
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
Open
function _renderShoot(shoot, entity, player, viewDist, screen, miniMap, gameCycleDelay, timeDelta) {
Function checkCollision
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
fn.prototype.checkCollision = function(fromX, fromY, toX, toY, radius, miniMap, screen) {