Showing 136 of 282 total issues
File main.js
has 1639 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
!function (t) {
var e = {};
function n(i) {
if (e[i]) return e[i].exports;
File blockrain.jquery.js
has 1258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* BlockRain.js 0.2.0
* jQuery plugin that lets you put a playable (and configurable) game of Tetris in your site or just leave it in auto in the background.
* http://aerolab.github.io/blockrain.js/
*
Function n
has 493 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var e, n = function () {
var e, n, i, r, a, o = [], s = o.concat, u = o.filter, c = o.slice, l = document, h = {}, f = {}, d = {"column-count": 1, columns: 1, "font-weight": 1, "line-height": 1, opacity: 1, "z-index": 1, zoom: 1},
p = /^\s*<(\w+|!)[^>]*>/, g = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, v = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, m = /^(?:body|html)$/i, y = /([A-Z])/g,
b = ["val", "css", "html", "text", "data", "width", "height", "offset"], E = l.createElement("table"), x = l.createElement("tr"),
T = {tr: l.createElement("tbody"), tbody: E, thead: E, tfoot: E, td: x, th: x, "*": l.createElement("div")}, O = /complete|loaded|interactive/, w = /^[\w-]*$/, A = {}, _ = A.toString, k = {}, M = l.createElement("div"),
Function E
has 333 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var m = l, y = u, b = c, E = function () {
function t() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
if (g(this, t), document.createElement("canvas").getContext) {
var n = e.canvasId, r = e.debug, a = e.width, o = e.height, s = e.highResolution, u = e.loadLimit, c = e.soundOn, l = a || window.innerWidth, h = o || window.innerHeight;
Function _SetupBoard
has 274 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_SetupBoard: function() {
var game = this;
var info = this._info;
File template7.js
has 592 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Template7 1.4.1
* Mobile-first HTML template engine
*
* http://www.idangero.us/template7/
File developer.ts
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as $ from 'jquery';
/**
* Developer tools, press 0 (by default) key four times to display developer tools
* You can see console logs in special layer in the app.
Function addHandlebarsHelpers
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function addHandlebarsHelpers(context): void {
Handlebars.registerHelper("math", function (lvalue, operator, rvalue, options) {
lvalue = parseFloat(lvalue);
rvalue = parseFloat(rvalue);
Function _SetupShapeFactory
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_SetupShapeFactory: function(){
var game = this;
if( this._shapeFactory !== null ){ return; }
Function Shape
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Shape(game, orientations, symmetrical, blockType) {
$.extend(this, {
x: 0,
y: 0,
Function stringToBlocks
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stringToBlocks: function stringToBlocks(string) {
var blocks = [];
var i;
var j;
if (!string) { return []; }
Function launch
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private launch(): void {
const self = this;
const ratio = 1.5;
let loadFinish, loadError, gameStart, game, score, successCount;
let domReady = true;
Function onKeyDown
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
onKeyDown(keyCode, event, fromRC) {
const scope = this;
if (this.isActive) {
if (document.activeElement && document.activeElement.nodeName === 'INPUT') {
alert('000');
- 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
File weather-codes.helper.ts
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export class WeatherCodesHelper {
public static codes = [
{
id: 0,
icon: 'tornado',
Function _getNiceShapes
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getNiceShapes: function() {
/*
* Things I need for this to work...
* - ability to test each shape with this._filled data
* - maybe give empty spots scores? and try to maximize the score?
Function cookie
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
static cookie(key: string, value?: string, options?: StoreOptions) {
if (!key) {
return false;
}
// Write
- 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 compile
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Template7Class.prototype.compile = function compile (template, depth) {
if ( template === void 0 ) template = this.template;
if ( depth === void 0 ) depth = 1;
var t = this;
Function _SetupFilled
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_SetupFilled: function() {
var game = this;
if( this._filled !== null ){ return; }
this._filled = {
Function _setupControls
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setupControls: function(enable) {
var game = this;
var moveLeft = function(start) {
Function drawBlock
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawBlock: function(x, y, blockType, blockVariation, blockIndex, blockRotation, falling) {
// convert x and y to pixel
x = x * game._block_size;
y = y * game._block_size;