Showing 282 of 282 total issues

Consider simplifying this complex logical expression.
Open

                    if (x && (E = "jsonp"), !1 !== y.cache && (r && !0 === r.cache || "script" != E && "jsonp" != E) || (y.url = m(y.url, "_=" + Date.now())), "jsonp" == E) return x || (y.url = m(y.url, y.jsonp ? y.jsonp + "=?" : !1 === y.jsonp ? "" : "callback=?")), e.ajaxJSONP(y, b);
Severity: Critical
Found in src/assets/js/games/tower/main.js - About 1 hr to fix

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

                            case 3:
                                i.status = "ROTATE_RIGHT", t.y = u, t.outwardOffset = a.collisionX + t.calWidth - t.x, c(t);
                                break;
    Severity: Major
    Found in src/assets/js/games/tower/main.js and 1 other location - About 1 hr to fix
    src/assets/js/games/tower/main.js on lines 1518..1520

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

    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

                            case 2:
                                i.status = "ROTATE_LEFT", t.y = u, t.outwardOffset = a.x + t.calWidth - t.x, c(t);
                                break;
    Severity: Major
    Found in src/assets/js/games/tower/main.js and 1 other location - About 1 hr to fix
    src/assets/js/games/tower/main.js on lines 1521..1523

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

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

            getBlockColor: function(blockType, blockVariation, blockIndex, falling) {
              /**
               * The theme allows us to do many things:
               * - Use a specific color for the falling block (primary), regardless of the proper color.
               * - Use another color for the placed blocks (secondary).
    Severity: Minor
    Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 hr to fix

      Function toConsole has a Cognitive Complexity of 11 (exceeds 5 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

      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 launch has a Cognitive Complexity of 11 (exceeds 5 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: Minor
      Found in src/modules/games/tower/tower.game.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

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

              this.templateHelper.render(template, { items: data, pageTitle: this.pageTitle }, this.$el, 'html', () => {
                  if (typeof callback === 'function')
                      callback(data);
              });
      Severity: Major
      Found in src/modules/news-sections/news-sections.module.ts and 1 other location - About 1 hr to fix
      src/modules/news/news.module.ts on lines 76..79

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

      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 ($select.find('option:selected').prev().is('option')) {
                          let $current = $select.find('option:selected');
                          $current.prev().prop('selected', 'selected');
                          $current.removeProp('selected');
                          $select.trigger('change');
      Severity: Major
      Found in src/modules/weather/weather.module.ts and 1 other location - About 1 hr to fix
      src/modules/weather/weather.module.ts on lines 121..126

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

      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 ($select.find('option:selected').next().is('option')) {
                          let $current = $select.find('option:selected');
                          $current.next().prop('selected', 'selected');
                          $current.removeProp('selected');
                          $select.trigger('change');
      Severity: Major
      Found in src/modules/weather/weather.module.ts and 1 other location - About 1 hr to fix
      src/modules/weather/weather.module.ts on lines 109..114

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

      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

              this.templateHelper.render(template, { items: data, pageTitle: this.pageTitle }, this.$el, 'html', () => {
                  if (typeof callback === 'function')
                      callback(data);
              });
      Severity: Major
      Found in src/modules/news/news.module.ts and 1 other location - About 1 hr to fix
      src/modules/news-sections/news-sections.module.ts on lines 66..69

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

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

            js_if: function js_if(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 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 onload has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    window.onload = (function () {
                        const $$video: any = self.broadcastVideo = document.getElementById("broadcastvideo");
                        const $$appManager: any = self.appManager = document.getElementById("appmgr");
                        self.configObject = document.getElementById("oipfcfg");
            
            
            Severity: Minor
            Found in src/app/bootstrap.ts - 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

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

                          this.input.addEvent('down', false, this.events['news.scroll-down'], () => {
                              const scrollValue = parseInt($newsDetails.css('top').replace('px', '')) - 100;
                              $newsDetails.css('top', scrollValue.toString() + 'px');
                          });
                  Severity: Major
                  Found in src/modules/news/news.module.ts and 1 other location - About 1 hr to fix
                  src/modules/news-sections/news-sections.module.ts on lines 221..224

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

                  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

                              if (newsHeight >= Math.abs(parseInt($newsDetails.css('top').replace('px', '')))) {
                                  const scrollValue = parseInt($newsDetails.css('top').replace('px', '')) - 100;
                                  $newsDetails.css('top', scrollValue.toString() + 'px');
                              }
                  Severity: Major
                  Found in src/modules/news-sections/news-sections.module.ts and 1 other location - About 1 hr to fix
                  src/modules/news/news.module.ts on lines 159..162

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

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

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

                        private loadDependencies(): void {
                            const self = this;
                            this.scripts.forEach((script) => {
                                self.scriptLoader.loadScript('head', script, true);
                            });
                    Severity: Major
                    Found in src/modules/games/2048/2048.game.ts and 1 other location - About 1 hr to fix
                    src/modules/games/2048/2048.game.ts on lines 77..82

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

                    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