Showing 136 of 282 total issues

File main.js has 1639 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function (t) {
    var e = {};

    function n(i) {
        if (e[i]) return e[i].exports;
Severity: Major
Found in src/assets/js/games/tower/main.js - About 4 days to fix

    File blockrain.jquery.js has 1258 lines of code (exceeds 250 allowed). Consider refactoring.
    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/
     *
    Severity: Major
    Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 3 days to fix

      Function n has 493 lines of code (exceeds 25 allowed). Consider refactoring.
      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"),
      Severity: Major
      Found in src/assets/js/games/tower/main.js - About 2 days to fix

        Function E has 333 lines of code (exceeds 25 allowed). Consider refactoring.
        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;
        Severity: Major
        Found in src/assets/js/games/tower/main.js - About 1 day to fix

          Function _SetupBoard has 274 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _SetupBoard: function() {
          
                var game = this;
                var info = this._info;
          
          
          Severity: Major
          Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 day to fix

            File template7.js has 592 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Template7 1.4.1
             * Mobile-first HTML template engine
             * 
             * http://www.idangero.us/template7/
            Severity: Major
            Found in src/_helpers/template7.js - About 1 day to fix

              File developer.ts has 480 lines of code (exceeds 250 allowed). Consider refactoring.
              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.
              Severity: Minor
              Found in src/_helpers/developer.ts - About 7 hrs to fix

                Function addHandlebarsHelpers has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function addHandlebarsHelpers(context): void {
                    Handlebars.registerHelper("math", function (lvalue, operator, rvalue, options) {
                        lvalue = parseFloat(lvalue);
                        rvalue = parseFloat(rvalue);
                
                
                Severity: Major
                Found in src/_helpers/handlebar.helper.ts - About 5 hrs to fix

                  Function _SetupShapeFactory has 142 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _SetupShapeFactory: function(){
                        var game = this;
                        if( this._shapeFactory !== null ){ return; }
                  
                  
                  
                  Severity: Major
                  Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 5 hrs to fix

                    Function Shape has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function Shape(game, orientations, symmetrical, blockType) {
                    
                            $.extend(this, {
                              x: 0,
                              y: 0,
                    Severity: Major
                    Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 4 hrs to fix

                      Function stringToBlocks has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          stringToBlocks: function stringToBlocks(string) {
                            var blocks = [];
                            var i;
                            var j;
                            if (!string) { return []; }
                      Severity: Major
                      Found in src/_helpers/template7.js - About 4 hrs to fix

                        Function launch has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private launch(): void {
                                const self = this;
                                const ratio = 1.5;
                                let loadFinish, loadError, gameStart, game, score, successCount;
                                let domReady = true;
                        Severity: Major
                        Found in src/modules/games/tower/tower.game.ts - About 4 hrs to fix

                          Function onKeyDown has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                          Open

                              onKeyDown(keyCode, event, fromRC) {
                                  const scope = this;
                                  if (this.isActive) {
                                      if (document.activeElement && document.activeElement.nodeName === 'INPUT') {
                                          alert('000');
                          Severity: Minor
                          Found in src/_helpers/developer.ts - About 4 hrs 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

                          File weather-codes.helper.ts has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          export class WeatherCodesHelper {
                              public static codes = [
                                  {
                                      id: 0,
                                      icon: 'tornado',
                          Severity: Minor
                          Found in src/modules/weather/weather-codes.helper.ts - About 3 hrs to fix

                            Function _getNiceShapes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                            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?
                            Severity: Major
                            Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 3 hrs to fix

                              Function cookie has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  static cookie(key: string, value?: string, options?: StoreOptions) {
                                      if (!key) {
                                          return false;
                                      }
                                      // Write
                              Severity: Minor
                              Found in src/_utilities/storage.utility.ts - About 3 hrs 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 compile has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                Template7Class.prototype.compile = function compile (template, depth) {
                                    if ( template === void 0 ) template = this.template;
                                    if ( depth === void 0 ) depth = 1;
                              
                                  var t = this;
                              Severity: Major
                              Found in src/_helpers/template7.js - About 3 hrs to fix

                                Function _SetupFilled has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _SetupFilled: function() {
                                      var game = this;
                                      if( this._filled !== null ){ return; }
                                
                                      this._filled = {
                                Severity: Major
                                Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 3 hrs to fix

                                  Function _setupControls has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _setupControls: function(enable) {
                                  
                                        var game = this;
                                  
                                        var moveLeft = function(start) {
                                  Severity: Major
                                  Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 3 hrs to fix

                                    Function drawBlock has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                    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;
                                    Severity: Major
                                    Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language