Showing 282 of 282 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            var moveLeft = function(event){
              event.preventDefault();
              game._board.cur.moveLeft();
              game._board.holding.left = Date.now();
              game._board.holding.right = null;
      Severity: Major
      Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 3 hrs to fix
      src/assets/js/games/blockrain/blockrain.jquery.js on lines 1570..1576

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 104.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            var moveRight = function(event){
              event.preventDefault();
              game._board.cur.moveRight();
              game._board.holding.right = Date.now();
              game._board.holding.left = null;
      Severity: Major
      Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 3 hrs to fix
      src/assets/js/games/blockrain/blockrain.jquery.js on lines 1563..1569

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 104.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            private goToCurrent($carousel): void {
                const self = this;
                try {
                    const $current = $carousel.find('li.current').parents('.slick-slide:first');
                    $carousel.slick('slickGoTo', $current.attr('data-slick-index'), true);
        Severity: Major
        Found in src/modules/schedule-carousel/schedule-carousel.module.ts and 1 other location - About 3 hrs to fix
        src/modules/sepehr/sepehr.module.ts on lines 281..292

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            private goToCurrentEpgItem($carousel): void {
                const self = this;
                try {
                    const $current = $carousel.find('li.current').parents('.slick-slide:first');
                    $carousel.slick('slickGoTo', $current.attr('data-slick-index'), true);
        Severity: Major
        Found in src/modules/sepehr/sepehr.module.ts and 1 other location - About 3 hrs to fix
        src/modules/schedule-carousel/schedule-carousel.module.ts on lines 75..86

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              if( typeof this._theme.complexBlocks !== 'undefined' ){
                var keys = Object.keys(this._theme.complexBlocks);
        
                // Load the complexBlocks
                for( var i = 0; i < keys.length; i++ ) {
        Severity: Major
        Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 3 hrs to fix
        src/assets/js/games/blockrain/blockrain.jquery.js on lines 1183..1190

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 101.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              else if( typeof this._theme.blocks !== 'undefined' ){
                var keys = Object.keys(this._theme.blocks);
        
                // Load the blocks
                for( var i = 0; i < keys.length; i++ ) {
        Severity: Major
        Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 3 hrs to fix
        src/assets/js/games/blockrain/blockrain.jquery.js on lines 1175..1190

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 101.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            private destroy(): void {
                const self = this;
                this.unloadDependencies();
                this.input.removeEvent('stop,s', {key: '2048.exit'});
                this.$el.fadeOut(100, () => {
        Severity: Major
        Found in src/modules/games/2048/2048.game.ts and 1 other location - About 3 hrs to fix
        src/modules/games/blockrain/blockrain.game.ts on lines 78..86

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            private destroy(): void {
                const self = this;
                this.unloadDependencies();
                this.input.removeEvent('stop,s', {key: 'blockrain.exit'});
                this.$el.fadeOut(100, () => {
        Severity: Major
        Found in src/modules/games/blockrain/blockrain.game.ts and 1 other location - About 3 hrs to fix
        src/modules/games/2048/2048.game.ts on lines 67..75

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                $el.on('afterChange', () => {
                    self.input.removeEvent('enter', self.events['sepehr-categories.enter']);
                    setTimeout(() => {
                        self.input.addEvent('enter', false, self.events['sepehr-categories.enter'], () => {
                            self.loadCategoryChannels($el);
        Severity: Major
        Found in src/modules/sepehr/sepehr.module.ts and 1 other location - About 3 hrs to fix
        src/modules/program/program.module.ts on lines 154..161

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 96.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                $el.on('afterChange', () => {
                    self.input.removeEvent('enter', self.events['program.play']);
                    setTimeout(() => {
                        self.input.addEvent('enter', false, self.events['program.play'], () => {
                            self.playVideo($el);
        Severity: Major
        Found in src/modules/program/program.module.ts and 1 other location - About 3 hrs to fix
        src/modules/sepehr/sepehr.module.ts on lines 68..75

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 96.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Consider simplifying this complex logical expression.
        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]);
        Severity: Critical
        Found in src/assets/js/games/tower/main.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

            Function appendUIStyles has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                appendUIStyles() {
                    let s = document.createElement('style');
                    let cssText = "\
            #developer-ui {\
            position: absolute;\
            Severity: Major
            Found in src/_helpers/developer.ts - About 2 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                        if( typeof game._theme.complexBlocks !== 'undefined' ) {
                          if( $.isArray(game._theme.complexBlocks[result.blockType]) ) {
                            result.blockVariation = game._randInt(0, game._theme.complexBlocks[result.blockType].length-1);
                          } else {
                            result.blockVariation = null;
              Severity: Major
              Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 2 hrs to fix
              src/assets/js/games/blockrain/blockrain.jquery.js on lines 797..803

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 94.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                        else if( typeof game._theme.blocks !== 'undefined' ) {
                          if( $.isArray(game._theme.blocks[result.blockType]) ) {
                            result.blockVariation = game._randInt(0, game._theme.blocks[result.blockType].length-1);
                          } else {
                            result.blockVariation = null;
              Severity: Major
              Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 2 hrs to fix
              src/assets/js/games/blockrain/blockrain.jquery.js on lines 790..803

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 94.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                        resultString += "r += (Template7Helpers.each).call(" + ctx + ", " + variable + ", {hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});";
              Severity: Major
              Found in src/_helpers/template7.js and 1 other location - About 2 hrs to fix
              src/_helpers/template7.js on lines 591..591

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 93.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language