Showing 282 of 282 total issues

Function tt has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    }, tt = function (t) {
        if (t.getVariable("GAME_START_NOW")) {
            var e = t.getInstance("block_".concat(t.getVariable("BLOCK_COUNT")));
            if (!e || [w, A].indexOf(e.status) > -1) {
                if (_(t) && k(t)) return;
Severity: Minor
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

        }, U = function (t, e) {
            var n = e.ctx, i = e.getImg(t.imgName);
            n.drawImage(i, t.x, t.y, t.width, t.height)
        }, G = function (t, e, n) {
    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 1599..1602

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

    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

        }, Y = function (t, e) {
            var n = e.ctx, i = e.getImg(t.imgName);
            n.drawImage(i, t.x, t.y, t.width, t.height)
        }, J = function (t, e, n) {
    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 1452..1455

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

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

            nextShape: function(_set_next_only) {
              var next = this.next,
                func, shape, result;
    
              if (info.mode == 'nice' || info.mode == 'evil') {
    Severity: Minor
    Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 hr to fix

      Function exports has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (config) {
          config.set({
              basePath: '',
              frameworks: ['jasmine'],
              files: [{ pattern: './tests/unit/spec-bundle.js', watched: false }],
      Severity: Minor
      Found in karma.conf.js - About 1 hr to fix

        Function arrayPolyfills has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function arrayPolyfills() {
            if (!Array.prototype.find) {
                Object.defineProperty(Array.prototype, 'find', {
                    value: function (predicate) {
                        // 1. Let O be ? ToObject(this value).
        Severity: Minor
        Found in src/libs/run-polyfills.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

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

            constructor(config?, layoutInstance?, moduleType?: string) {
                super(config, layoutInstance, moduleType);
                this.service = QuranService.instance;
                this.events = this.prepareControls();
                this.load();
        Severity: Major
        Found in src/modules/quran/quran.module.ts and 2 other locations - About 1 hr to fix
        src/modules/market/market.module.ts on lines 17..23
        src/modules/program/program.module.ts on lines 21..27

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

        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

            constructor(config?, layoutInstance?, moduleType?: string) {
                super(config, layoutInstance, moduleType);
                this.service = MarketService.instance;
                this.events = this.prepareControls();
                this.load();
        Severity: Major
        Found in src/modules/market/market.module.ts and 2 other locations - About 1 hr to fix
        src/modules/program/program.module.ts on lines 21..27
        src/modules/quran/quran.module.ts on lines 25..31

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

        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

            constructor(config?, layoutInstance?, moduleType?: string) {
                super(config, layoutInstance, moduleType);
                this.service = ProgramService.instance;
                this.events = this.prepareControls();
                this.load();
        Severity: Major
        Found in src/modules/program/program.module.ts and 2 other locations - About 1 hr to fix
        src/modules/market/market.module.ts on lines 17..23
        src/modules/quran/quran.module.ts on lines 25..31

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

        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.input.addEvent('up', false, this.events['news.scroll-up'], () => {
                    const scrollValue = parseInt($newsDetails.css('top').replace('px', '')) + 100;
                    if (scrollValue <= 0)
                        $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 226..230

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

        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

            protected events = {
                'schedule.prev': { 'control': 'up', title: 'برنامه قبلی', icon: 'up' },
                'schedule.next': { 'control': 'down', title: 'برنامه بعدی', icon: 'bottom' },
                'schedule.enter': { 'control': 'enter', title: 'پخش ویدیو', icon: 'enter' },
            };
        Severity: Major
        Found in src/modules/schedule-carousel/schedule-carousel.module.ts and 1 other location - About 1 hr to fix
        src/modules/faq/faq.module.ts on lines 13..17

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

        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

            protected events = {
                'faq.down': {'control': 'down', title: 'آیتم بعدی', icon: 'bottom'},
                'faq.up': {'control': 'up', title: 'آیتم قبلی', icon: 'up'},
                'faq.enter': {'control': 'enter', title: 'نمایش توضیحات', icon: 'enter'},
            };
        Severity: Major
        Found in src/modules/faq/faq.module.ts and 1 other location - About 1 hr to fix
        src/modules/schedule-carousel/schedule-carousel.module.ts on lines 9..13

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

        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.input.addEvent('up', false, { key: 'news.scroll-up' }, () => {
                    const scrollValue = parseInt($newsDetails.css('top').replace('px', '')) + 100;
                    if (scrollValue <= 0)
                        $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 163..167

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

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

                        }, e.ajax = function (r) {
                            var o, g, y = e.extend({}, r || {}), b = e.Deferred && e.Deferred();
                            for (n in e.ajaxSettings) void 0 === y[n] && (y[n] = e.ajaxSettings[n]);
                            !function (t) {
                                t.global && 0 == e.active++ && h(t, null, "ajaxStart")
        Severity: Minor
        Found in src/assets/js/games/tower/main.js - About 1 hr to fix

          Function rotate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    rotate: function(direction) {
                      var orientation =
                        (this.orientation + (direction === "left" ? 1 : -1) + 4) % 4;
          
                      if (!game._checkCollisions(
          Severity: Minor
          Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                                            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;
                                                try {
            Severity: Critical
            Found in src/assets/js/games/tower/main.js - About 1 hr to fix

              Function getCompileVar has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getCompileVar: function getCompileVar(name, ctx, data) {
                    if ( data === void 0 ) data = 'data_1';
              
                    var variable = ctx;
                    var parts;
              Severity: Minor
              Found in src/_helpers/template7.js - About 1 hr to fix

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

                    public getEpisodes(programId: number): JQuery.jqXHR {
                        return this.http.get(this.api.get('program.episodes').replace(/{programId}/, programId.toString()));
                    }
                Severity: Major
                Found in src/modules/program/program.service.ts and 1 other location - About 1 hr to fix
                src/modules/program/program.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 66.

                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 getList(programType: number): JQuery.jqXHR {
                        return this.http.get(this.api.get('program.list').replace(/{programType}/, programType.toString()));
                    }
                Severity: Major
                Found in src/modules/program/program.service.ts and 1 other location - About 1 hr to fix
                src/modules/program/program.service.ts on lines 13..15

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

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

                GameManager.prototype.move = function (direction) {
                  // 0: up, 1: right, 2: down, 3: left
                  var self = this;
                
                  if (this.isGameTerminated()) return; // Don't do anything if the game's over
                Severity: Minor
                Found in src/assets/js/games/2048/game_manager.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language