Showing 136 of 282 total issues
Consider simplifying this complex logical expression. Open
Open
if (b && b.promise(k), y.crossDomain || A("X-Requested-With", "XMLHttpRequest"), A("Accept", O || "*/*"), (O = y.mimeType || O) && (O.indexOf(",") > -1 && (O = O.split(",", 2)[0]), k.overrideMimeType && k.overrideMimeType(O)), (y.contentType || !1 !== y.contentType && y.data && "GET" != y.type.toUpperCase()) && A("Content-Type", y.contentType || "application/x-www-form-urlencoded"), y.headers) for (i in y.headers) A(i, y.headers[i]);
Function appendUIStyles
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
appendUIStyles() {
let s = document.createElement('style');
let cssText = "\
#developer-ui {\
position: absolute;\
Function listen
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
KeyboardInputManager.prototype.listen = function () {
var self = this;
var map = {
38: 0, // Up
Function $
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}, $ = function (t, e, n) {
var i = t, r = typeof e !== 'undefined' ? e.getVariable("ROPE_HEIGHT") : 0;
if (i.visible) {
i.ready || (i.ready = !0, i.status = "SWING", t.updateWidth(e.getVariable("BLOCK_WIDTH")), t.updateHeight(e.getVariable("BLOCK_HEIGHT")), t.x = e.width / 2, t.y = -1.5 * r);
var a = e.getInstance("line");
File sepehr.module.ts
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as moment from 'moment-jalaali';
import { Module } from '../../libs';
import template from './sepehr.template.html';
import categoriesTemplate from './sepehr-categories.template.html';
import channelsTemplate from './sepehr-channels.template.html';
File hotkeys.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* hotkeys-js v3.3.8
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2018 kenny wong <wowohoo@qq.com>
Consider simplifying this complex logical expression. Open
Open
if (i.visible) {
i.ready || (i.ready = !0, i.status = "SWING", t.updateWidth(e.getVariable("BLOCK_WIDTH")), t.updateHeight(e.getVariable("BLOCK_HEIGHT")), t.x = e.width / 2, t.y = -1.5 * r);
var a = e.getInstance("line");
switch (i.status) {
case"SWING":
File player.helper.ts
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import TemplateHelper from './template.helper';
import Inputs from '../app/inputs';
import videojs from 'video.js';
import { Event } from '../_models';
Function animate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
animate: function() {
var drop = false,
moved = false,
gameOver = false,
now = Date.now();
Function _setupTouchControls
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setupTouchControls: function(enable) {
var game = this;
// Movements can be held for faster movement
Function polyfillConsole
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
polyfillConsole() {
const scope = this;
if (typeof window.console === 'undefined') {
(<any>window).console = <Console>({
Function helperToSlices
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
helperToSlices: function helperToSlices(string) {
var quoteDoubleRexExp = Template7Utils.quoteDoubleRexExp;
var quoteSingleRexExp = Template7Utils.quoteSingleRexExp;
var helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');
var slices = [];
SepehrModule
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class SepehrModule extends Module {
private readonly currentDate;
protected events = {
'sepehr-categories.prev': { control: 'right', title: 'قبلی', icon: 'right' },
Developer
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class Developer {
config = {
debug: true,
/**
Function tileMatchesAvailable
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
GameManager.prototype.tileMatchesAvailable = function () {
var self = this;
var tile;
- 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 _preloadThemeAssets
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_preloadThemeAssets: function() {
var game = this;
var hexColorcheck = new RegExp('^#[A-F0-9+]{3,6}', 'i');
Function onKeyDown
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onKeyDown(keyCode, event, fromRC) {
const scope = this;
if (this.isActive) {
if (document.activeElement && document.activeElement.nodeName === 'INPUT') {
alert('000');
Function func
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var func = function(filled, checkCollisions, width, height, mode, _one_shape) {
if (!_one_shape) resetShapes();
var possibles = new Array(width * height),
evil = mode == 'evil',
Function cookie
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static cookie(key: string, value?: string, options?: StoreOptions) {
if (!key) {
return false;
}
// Write
Function tt
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}, tt = function (t) {
if (t.getVariable("GAME_START_NOW")) {
var e = t.getInstance("block_".concat(t.getVariable("BLOCK_COUNT")));
if (!e || [w, A].indexOf(e.status) > -1) {
if (_(t) && k(t)) return;