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;
      }
Severity: Minor
Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 hr to fix

    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;
            }
    Severity: Minor
    Found in src/_helpers/template7.js - About 1 hr to fix

      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'))
      Severity: Minor
      Found in src/modules/schedule-carousel/schedule-carousel.module.ts - About 1 hr to fix

        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);
        Severity: Minor
        Found in src/_helpers/developer.ts - About 1 hr to fix

          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 {
          Severity: Minor
          Found in src/_helpers/player.helper.ts - About 1 hr to fix

            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);
            Severity: Minor
            Found in src/_helpers/player.helper.ts - 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 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) {
            Severity: Minor
            Found in src/_helpers/player.helper.ts - 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 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) {
            Severity: Minor
            Found in src/modules/stream/stream.module.ts - 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 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");
            Severity: Minor
            Found in src/app/bootstrap.ts - 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 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;
            Severity: Minor
            Found in src/libs/module.ts - 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 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';
            Severity: Minor
            Found in src/_helpers/developer.ts - 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 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) {
            Severity: Minor
            Found in src/_helpers/developer.ts - 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 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) {
            Severity: Minor
            Found in src/_helpers/template7.js - About 1 hr to fix

              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"));
              Severity: Minor
              Found in src/assets/js/games/tower/main.js - About 1 hr to fix

                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");
                Severity: Minor
                Found in src/assets/js/games/2048/html_actuator.js - About 1 hr to fix

                  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);
                  
                  
                  Severity: Minor
                  Found in src/_helpers/developer.ts - About 1 hr to fix

                    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).
                    Severity: Minor
                    Found in src/libs/run-polyfills.ts - About 1 hr to fix

                      Function _create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _create: function() {
                      
                            var game = this;
                      
                            this.theme(this.options.theme);
                      Severity: Minor
                      Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 hr to fix

                        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();
                        Severity: Major
                        Found in src/_helpers/hotkeys.js - About 1 hr to fix

                          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 = {
                          Severity: Major
                          Found in src/assets/js/games/tower/main.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language