Showing 282 of 282 total issues

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

    private renderSurah(data: Surah, callback?): void {
        this.templateHelper.render(surahTemplate, data, $('#surah'), 'html', function () {
            if (typeof callback === 'function')
                callback(data);
        });
Severity: Minor
Found in src/modules/quran/quran.module.ts and 1 other location - About 40 mins to fix
src/modules/weather/weather.module.ts on lines 72..77

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

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 (t.getVariable("GAME_START_NOW") && !(t.debug && t.paused || "HOOK_NORMAL" !== S(t))) {
            t.removeInstance("tutorial"), t.removeInstance("tutorial-arrow");
            var e = t.getInstance("block_".concat(t.getVariable("BLOCK_COUNT")));
            e && "SWING" === e.status && (t.setTimeMovement("HOOK_UP_MOVEMENT", 500), e.status = "BEFORE_DROP")
        }
Severity: Major
Found in src/assets/js/games/tower/main.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                                if (k.status >= 200 && k.status < 300 || 304 == k.status || 0 == k.status && "file:" == _) {
                                    if (E = E || function (t) {
                                        return t && (t = t.split(";", 2)[0]), t && ("text/html" == t ? "html" : "application/json" == t ? "json" : s.test(t) ? "script" : u.test(t) && "xml") || "text"
                                    }(y.mimeType || k.getResponseHeader("content-type")), "arraybuffer" == k.responseType || "blob" == k.responseType) t = k.response; else {
                                        t = k.responseText;
    Severity: Major
    Found in src/assets/js/games/tower/main.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (c) {
                          c.processing || (this.timeMovementStartArr.push(t), c.store[u] = [], e.forEach((function (t) {
                              c.store[u].push({start: parseFloat(t[0]), end: parseFloat(t[1])})
                          })), a && a());
                          var l = function () {
      Severity: Major
      Found in src/assets/js/games/tower/main.js - About 40 mins to fix

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

                        }, e.fn.live = function (t, n) {
                            return e(document.body).delegate(this.selector, t, n), this
                        }, e.fn.die = function (t, n) {
        Severity: Minor
        Found in src/assets/js/games/tower/main.js and 1 other location - About 40 mins to fix
        src/assets/js/games/tower/main.js on lines 654..656

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

        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

              game._$gameover.find('.blockrain-game-over-btn').click(function(event){
                event.preventDefault();
                game.restart();
              });
        Severity: Minor
        Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 40 mins to fix
        src/assets/js/games/blockrain/blockrain.jquery.js on lines 1253..1256

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

        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 (options.root && execute.indexOf('@root') >= 0) {
                execute = Template7Utils.parseJsVariable(execute, '@root', options.root);
              }
        Severity: Minor
        Found in src/_helpers/template7.js and 1 other location - About 40 mins to fix
        src/_helpers/template7.js on lines 441..443

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

        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

            public addClass(classToAdd: string, element: any): void {
                const $element = this.getElement(element);
                $element.addClass(classToAdd);
            }
        Severity: Minor
        Found in src/_helpers/template.helper.ts and 2 other locations - About 40 mins to fix
        src/_helpers/template.helper.ts on lines 96..99
        src/_helpers/template.helper.ts on lines 101..104

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

        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

            public removeClass(classToRemove: string, element: any): void {
                const $element = this.getElement(element);
                $element.removeClass(classToRemove);
            }
        Severity: Minor
        Found in src/_helpers/template.helper.ts and 2 other locations - About 40 mins to fix
        src/_helpers/template.helper.ts on lines 86..89
        src/_helpers/template.helper.ts on lines 101..104

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

        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

              game._$start.find('.blockrain-start-btn').click(function(event){
                event.preventDefault();
                game.start();
              });
        Severity: Minor
        Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 40 mins to fix
        src/assets/js/games/blockrain/blockrain.jquery.js on lines 1266..1269

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

        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

            public prepend(content: string, element: any): void {
                const $element = this.getElement(element);
                $element.prepend(content);
            }
        Severity: Minor
        Found in src/_helpers/template.helper.ts and 2 other locations - About 40 mins to fix
        src/_helpers/template.helper.ts on lines 86..89
        src/_helpers/template.helper.ts on lines 96..99

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

        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

                        }, e.fn.die = function (t, n) {
                            return e(document.body).undelegate(this.selector, t, n), this
                        }, e.fn.on = function (t, n, o, s, u) {
        Severity: Minor
        Found in src/assets/js/games/tower/main.js and 1 other location - About 40 mins to fix
        src/assets/js/games/tower/main.js on lines 652..654

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

        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

            public getItem(itemId: number) {
                return this.http.get(this.api.get('items', itemId.toString()));
            }
        Severity: Minor
        Found in src/modules/faq/faq.service.ts and 1 other location - About 40 mins to fix
        src/modules/news/news.service.ts on lines 17..19

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

        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

            public getNewsDetails(itemId: number) {
                return this.http.get(this.api.get('news', itemId.toString()));
            }
        Severity: Minor
        Found in src/modules/news/news.service.ts and 1 other location - About 40 mins to fix
        src/modules/faq/faq.service.ts on lines 9..11

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

        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 (options.root && execute.indexOf('@root') >= 0) {
                execute = Template7Utils.parseJsVariable(execute, '@root', options.root);
              }
        Severity: Minor
        Found in src/_helpers/template7.js and 1 other location - About 40 mins to fix
        src/_helpers/template7.js on lines 470..472

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

        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 p has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                        function p(t, e, n, i, r) {
        Severity: Minor
        Found in src/assets/js/games/tower/main.js - About 35 mins to fix

          Function on has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                          }, e.fn.on = function (t, n, o, s, u) {
          Severity: Minor
          Found in src/assets/js/games/tower/main.js - About 35 mins to fix

            Function m has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                            function m(t, e, n, i, r) {
            Severity: Minor
            Found in src/assets/js/games/tower/main.js - About 35 mins to fix

              Function is_localstorage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  static is_localstorage(): boolean {
                      if (typeof localStorage !== 'undefined') {
                          try {
                              localStorage.setItem('feature_test', 'yes');
                              if (localStorage.getItem('feature_test') === 'yes') {
              Severity: Minor
              Found in src/_utilities/storage.utility.ts - About 35 mins 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 disableBroadcast has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public disableBroadcast() {
                      const $tv = this.getBroadcastVideo();
                      if ($('#tv-stream').length && typeof videojs('tv-stream') !== 'undefined') {
                          videojs('tv-stream').muted(true);
                      }
              Severity: Minor
              Found in src/_helpers/player.helper.ts - About 35 mins 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

              Severity
              Category
              Status
              Source
              Language