Showing 282 of 282 total issues

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

          resultString += "r += (Template7Helpers.with).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 589..589

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

Function listen has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

KeyboardInputManager.prototype.listen = function () {
  var self = this;

  var map = {
    38: 0, // Up
Severity: Major
Found in src/assets/js/games/2048/keyboard_input_manager.js - About 2 hrs to fix

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

      File sepehr.module.ts has 281 lines of code (exceeds 250 allowed). Consider refactoring.
      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';
      Severity: Minor
      Found in src/modules/sepehr/sepehr.module.ts - About 2 hrs to fix

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

          Consider simplifying this complex logical expression.
          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":
          Severity: Critical
          Found in src/assets/js/games/tower/main.js - About 2 hrs to fix

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

                                        r.angle = a * M(e, n), r.weightX = r.x + Math.sin(r.angle) * i, r.weightY = r.y + Math.cos(r.angle) * i
            Severity: Major
            Found in src/assets/js/games/tower/main.js and 1 other location - About 2 hrs to fix
            src/assets/js/games/tower/main.js on lines 1467..1467

            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 88.

            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

                    t.angle = r * M(e, n), t.weightX = t.x + Math.sin(t.angle) * i, t.weightY = t.y + Math.cos(t.angle) * i
            Severity: Major
            Found in src/assets/js/games/tower/main.js and 1 other location - About 2 hrs to fix
            src/assets/js/games/tower/main.js on lines 1499..1499

            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 88.

            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

            File player.helper.ts has 275 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import TemplateHelper from './template.helper';
            import Inputs from '../app/inputs';
            import videojs from 'video.js';
            import { Event } from '../_models';
            
            
            Severity: Minor
            Found in src/_helpers/player.helper.ts - About 2 hrs to fix

              Function animate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      animate: function() {
                        var drop = false,
                            moved = false,
                            gameOver = false,
                            now = Date.now();
              Severity: Major
              Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 2 hrs to fix

                Function _setupTouchControls has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _setupTouchControls: function(enable) {
                
                      var game = this;
                
                      // Movements can be held for faster movement
                Severity: Major
                Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 2 hrs to fix

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

                      private render(callback?): void {
                          const self = this;
                          this.templateHelper.render(template, {}, this.$el, 'html', function () {
                              self.$el.fadeIn(100);
                              if (typeof callback === 'function')
                  Severity: Major
                  Found in src/modules/games/blockrain/blockrain.game.ts and 1 other location - About 2 hrs to fix
                  src/modules/games/2048/2048.game.ts on lines 43..50

                  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 80.

                  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 3 locations. Consider refactoring.
                  Open

                      private registerKeyboardInputs(): void {
                          const self = this;
                          const stopParams = {key: 'blockrain.exit', title: 'خروج از بازی', icon: 'stop', button: true};
                          this.input.addEvent('stop,s', false, stopParams, () => {
                              self.destroy();
                  Severity: Major
                  Found in src/modules/games/blockrain/blockrain.game.ts and 2 other locations - About 2 hrs to fix
                  src/modules/games/2048/2048.game.ts on lines 52..58
                  src/modules/games/tower/tower.game.ts on lines 182..188

                  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 80.

                  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 3 locations. Consider refactoring.
                  Open

                      private registerKeyboardInputs(): void {
                          const self = this;
                          const stopParams = {key: 'tower.exit', title: 'خروج از بازی', icon: 'stop', button: true};
                          this.input.addEvent('stop,s', false, stopParams, () => {
                              self.destroy();
                  Severity: Major
                  Found in src/modules/games/tower/tower.game.ts and 2 other locations - About 2 hrs to fix
                  src/modules/games/2048/2048.game.ts on lines 52..58
                  src/modules/games/blockrain/blockrain.game.ts on lines 60..66

                  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 80.

                  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 3 locations. Consider refactoring.
                  Open

                      private registerKeyboardInputs(): void {
                          const self = this;
                          const stopParams = {key: '2048.exit', title: 'خروج از بازی', icon: 'stop', button: true};
                          this.input.addEvent('stop,s', false, stopParams, () => {
                              self.destroy();
                  Severity: Major
                  Found in src/modules/games/2048/2048.game.ts and 2 other locations - About 2 hrs to fix
                  src/modules/games/blockrain/blockrain.game.ts on lines 60..66
                  src/modules/games/tower/tower.game.ts on lines 182..188

                  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 80.

                  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

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

                      private render(callback?): void {
                          const self = this;
                          this.templateHelper.render(template, {}, this.$el, 'html', function () {
                              self.$el.fadeIn(100);
                              if (typeof callback === 'function')
                  Severity: Major
                  Found in src/modules/games/2048/2048.game.ts and 1 other location - About 2 hrs to fix
                  src/modules/games/blockrain/blockrain.game.ts on lines 51..58

                  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 80.

                  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 polyfillConsole has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      polyfillConsole() {
                          const scope = this;
                  
                          if (typeof window.console === 'undefined') {
                              (<any>window).console = <Console>({
                  Severity: Major
                  Found in src/_helpers/developer.ts - About 2 hrs to fix

                    Function helperToSlices has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        helperToSlices: function helperToSlices(string) {
                          var quoteDoubleRexExp = Template7Utils.quoteDoubleRexExp;
                          var quoteSingleRexExp = Template7Utils.quoteSingleRexExp;
                          var helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');
                          var slices = [];
                    Severity: Major
                    Found in src/_helpers/template7.js - About 2 hrs to fix

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

                          if (window.navigator.msPointerEnabled) {
                            touchEndClientX = event.pageX;
                            touchEndClientY = event.pageY;
                          } else {
                            touchEndClientX = event.changedTouches[0].clientX;
                      Severity: Major
                      Found in src/assets/js/games/2048/keyboard_input_manager.js and 1 other location - About 2 hrs to fix
                      src/assets/js/games/2048/keyboard_input_manager.js on lines 86..92

                      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 79.

                      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 (window.navigator.msPointerEnabled) {
                            touchStartClientX = event.pageX;
                            touchStartClientY = event.pageY;
                          } else {
                            touchStartClientX = event.touches[0].clientX;
                      Severity: Major
                      Found in src/assets/js/games/2048/keyboard_input_manager.js and 1 other location - About 2 hrs to fix
                      src/assets/js/games/2048/keyboard_input_manager.js on lines 109..115

                      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 79.

                      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