Showing 136 of 282 total issues
Function _drawBackground
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawBackground: function() {
if( typeof this._theme.background !== 'string' ) {
return;
}
Function parseJsParents
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseJsParents: function parseJsParents(expression, parents) {
return expression.split(/([+ \-*^()&=|<>!%:?])/g).reduce(function (arr, part) {
if (!part) {
return arr;
}
Function initializeSlider
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private initializeSlider(): void {
const self = this;
const $el = $("ul.schedule-items");
const slidesToShow = 5;
if (!$el.is(':visible'))
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(config) {
let onerror, scope = this;
this.canAccessError = this.isErrorAvailable();
this.configure(config);
Function rewind
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public rewind() {
const self = this;
const player = this.type === 'videojs' ? videojs(this.playerId) : this.instance[0];
this.instance.userActive(true);
try {
Function reInitBroadcast
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public reInitBroadcast() {
const $tv = this.getBroadcastVideo();
if ($('#tv-stream').length && typeof videojs('tv-stream') !== 'undefined') {
try {
videojs('tv-stream').muted(false);
- 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 play
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public play(initial: boolean = false) {
const self = this;
this.setPlaybackSpeed(1);
this.status = 'playing';
if (initial) {
- 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 pip
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
pip(start: boolean = true, callback?): void {
const method = start ? 'addClass' : 'removeClass';
$("#content")[method]('half');
$('body')[method]('broadcast-half');
if (start) {
- 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 preFlight
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private preFlight(callback): void {
const self = this;
window.onload = (function () {
const $$video: any = self.broadcastVideo = document.getElementById("broadcastvideo");
const $$appManager: any = self.appManager = document.getElementById("appmgr");
- 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 prepareControls
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public prepareControls(): any {
let events = this.events;
for (let key in events) {
if (typeof events[key]['key'] === 'undefined')
events[key]['key'] = key;
- 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 getTextValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
getTextValue(keycode) {
if (keycode === this.key.ONE || keycode === 1) {
return '1';
} else if (keycode === this.key.TWO || keycode === 2) {
return '2';
- 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 updateNotifications
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
updateNotifications() {
let errors = 0, networkErrors = 0;
for (let i in this.consoleStack) {
if (this.consoleStack[i].isError) {
- 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 js
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
js: function js(expression, options) {
var data = options.data;
var func;
var execute = expression;
('index first last key').split(' ').forEach(function (prop) {
Function TowerGameJS
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.TowerGameJS = function () {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, e = t.width, n = t.height, i = t.canvasId, r = t.soundOn, a = new E({canvasId: i, highResolution: !0, width: e, height: n, soundOn: r}), o = function (t) {
return "./assets/img/games/tower/".concat(t)
};
a.addImg("background", o("background.png")), a.addImg("hook", o("hook.png")), a.addImg("blockRope", o("block-rope.png")), a.addImg("block", o("block.png")), a.addImg("block-perfect", o("block-perfect.png"));
Function addTile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
HTMLActuator.prototype.addTile = function (tile) {
var self = this;
var wrapper = document.createElement("div");
var inner = document.createElement("div");
Function toConsole
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
toConsole(type, args) {
let line, t;
args = Array.prototype.slice.apply(args);
Function arrayPolyfills
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function arrayPolyfills() {
if (!Array.prototype.find) {
Object.defineProperty(Array.prototype, 'find', {
value: function (predicate) {
// 1. Let O be ? ToObject(this value).
Function _create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
var game = this;
this.theme(this.options.theme);
Consider simplifying this complex logical expression. Open
if (handler.mods.length === 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91] || modifiersMatch || handler.shortcut === '*') {
// Call the handler, if it is a modifier key, it will not be processed.
if (handler.method(event, handler) === false) {
if (event.preventDefault) event.preventDefault(); else event.returnValue = false;
if (event.stopPropagation) event.stopPropagation();
Consider simplifying this complex logical expression. Open
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;
this.canvas = document.getElementById(n), s && (this.canvas.style.width = "".concat(l, "px"), this.canvas.style.height = "".concat(h, "px"), l *= 2, h *= 2), this.highResolution = s, this.canvas.width = l, this.canvas.height = h, this.width = this.canvas.width, this.height = this.canvas.height, this.calWidth = .5 * this.width, this.calHeight = .5 * this.height, this.debug = !!r, this.ctx = this.canvas.getContext("2d"), this.defaultLayer = "default", this.layerArr = [this.defaultLayer], this.instancesObj = {}, this.instancesObj[this.defaultLayer] = [], this.instancesReactionArr = [], this.utils = i, this.customVariable = {};
var f = this;
this.isTouchDevice = b(), this.debugArr = [], this.assetsObj = {image: {}, audio: {}}, this.assetsCount = {