Showing 282 of 282 total issues

SepehrModule has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class SepehrModule extends Module {

    private readonly currentDate;
    protected events = {
        'sepehr-categories.prev': { control: 'right', title: 'قبلی', icon: 'right' },
Severity: Minor
Found in src/modules/sepehr/sepehr.module.ts - About 2 hrs to fix

    Developer has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class Developer {
    
        config = {
            debug: true,
            /**
    Severity: Minor
    Found in src/_helpers/developer.ts - About 2 hrs to fix

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

              setTimeout(() => {
                  self.input.removeEvent('p,pause', self.events['player.pause']);
                  self.input.addEvent('p,play', false, self.events['player.play'], () => {
                      self.play();
                  });
      Severity: Major
      Found in src/_helpers/player.helper.ts and 1 other location - About 2 hrs to fix
      src/_helpers/player.helper.ts on lines 214..219

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

      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

              setTimeout(() => {
                  self.input.removeEvent('p,play', self.events['player.play']);
                  self.input.addEvent('p,pause', false, self.events['player.pause'], () => {
                      self.pause();
                  });
      Severity: Major
      Found in src/_helpers/player.helper.ts and 1 other location - About 2 hrs to fix
      src/_helpers/player.helper.ts on lines 232..237

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

      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 tileMatchesAvailable has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      GameManager.prototype.tileMatchesAvailable = function () {
        var self = this;
      
        var tile;
      
      
      Severity: Minor
      Found in src/assets/js/games/2048/game_manager.js - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function _preloadThemeAssets has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _preloadThemeAssets: function() {
      
            var game = this;
      
            var hexColorcheck = new RegExp('^#[A-F0-9+]{3,6}', 'i');
      Severity: Major
      Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 2 hrs to fix

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

                this.service[service](id).done((data: any) => {
                    self.data = data.data;
                    self.render(self.data, (data: News[]) => {
                        // End loading
                        self.templateHelper.loading(false);
        Severity: Major
        Found in src/modules/news/news.module.ts and 2 other locations - About 2 hrs to fix
        src/modules/news-sections/news-sections.module.ts on lines 54..61
        src/modules/program/program.module.ts on lines 32..39

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

        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

                this.service.getNews().done((data: DefaultResponse<NewsCategory>) => {
                    self.categories = data.data;
                    self.render(self.categories, (data: NewsCategory[]) => {
                        // End loading
                        self.templateHelper.loading(false);
        Severity: Major
        Found in src/modules/news-sections/news-sections.module.ts and 2 other locations - About 2 hrs to fix
        src/modules/news/news.module.ts on lines 64..71
        src/modules/program/program.module.ts on lines 32..39

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

        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 = $(
                '<div class="blockrain-start-holder" style="position:absolute;">'+
                  '<div class="blockrain-start">'+
                    '<div class="blockrain-start-msg">'+ this.options.playText +'</div>'+
                    '<a class="blockrain-btn blockrain-start-btn">'+ this.options.playButtonText +'</a>'+
        Severity: Major
        Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 2 hrs to fix
        src/assets/js/games/blockrain/blockrain.jquery.js on lines 1259..1265

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

        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

                this.service.getLatest().done((data: DefaultResponse) => {
                    self.data = data.data;
                    self.render(self.data, (data: Program[]) => {
                        // End loading
                        self.templateHelper.loading(false);
        Severity: Major
        Found in src/modules/program/program.module.ts and 2 other locations - About 2 hrs to fix
        src/modules/news-sections/news-sections.module.ts on lines 54..61
        src/modules/news/news.module.ts on lines 64..71

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

        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 = $(
                '<div class="blockrain-game-over-holder" style="position:absolute;">'+
                  '<div class="blockrain-game-over">'+
                    '<div class="blockrain-game-over-msg">'+ this.options.gameOverText +'</div>'+
                    '<a class="blockrain-btn blockrain-game-over-btn">'+ this.options.restartButtonText +'</a>'+
        Severity: Major
        Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 2 hrs to fix
        src/assets/js/games/blockrain/blockrain.jquery.js on lines 1244..1250

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

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

            onKeyDown(keyCode, event, fromRC) {
                const scope = this;
                if (this.isActive) {
                    if (document.activeElement && document.activeElement.nodeName === 'INPUT') {
                        alert('000');
        Severity: Minor
        Found in src/_helpers/developer.ts - About 2 hrs to fix

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

                  if (networkErrors > 0 && this.$elNetworkErrors) {
                      this.$elNetworkErrors.text(networkErrors).show();
          
                  } else if (this.$elNetworkErrors) {
                      this.$elNetworkErrors.text('0').hide();
          Severity: Major
          Found in src/_helpers/developer.ts and 1 other location - About 2 hrs to fix
          src/_helpers/developer.ts on lines 596..601

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

          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 (errors > 0 && this.$elErrors) {
                      this.$elErrors.text(errors).show();
          
                  } else if (this.$elErrors) {
                      this.$elErrors.text('0').hide();
          Severity: Major
          Found in src/_helpers/developer.ts and 1 other location - About 2 hrs to fix
          src/_helpers/developer.ts on lines 603..608

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

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

                var func = function(filled, checkCollisions, width, height, mode, _one_shape) {
                  if (!_one_shape) resetShapes();
          
                  var possibles = new Array(width * height),
                      evil = mode == 'evil',
          Severity: Minor
          Found in src/assets/js/games/blockrain/blockrain.jquery.js - About 1 hr to fix

            Function cookie has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static cookie(key: string, value?: string, options?: StoreOptions) {
                    if (!key) {
                        return false;
                    }
                    // Write
            Severity: Minor
            Found in src/_utilities/storage.utility.ts - About 1 hr to fix

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

                        moveRight: function() {
                          if (!game._checkCollisions(this.x + 1, this.y, this.getBlocks())) {
                            this.x++;
                            game._board.renderChanged = true;
                          }
              Severity: Major
              Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 1 hr to fix
              src/assets/js/games/blockrain/blockrain.jquery.js on lines 505..510

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

              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

              export interface Schedule {
                  mediaId: number;
                  description: string;
                  start: string;
                  duration: string;
              Severity: Major
              Found in src/modules/schedule-carousel/schedule.model.ts and 1 other location - About 1 hr to fix
              src/modules/sepehr/sepehr.models.ts on lines 26..36

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

              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

              export interface SepehrEpg {
                  mediaId: number;
                  description: string;
                  start: string;
                  duration: string;
              Severity: Major
              Found in src/modules/sepehr/sepehr.models.ts and 1 other location - About 1 hr to fix
              src/modules/schedule-carousel/schedule.model.ts on lines 1..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 72.

              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

                        moveLeft: function() {
                          if (!game._checkCollisions(this.x - 1, this.y, this.getBlocks())) {
                            this.x--;
                            game._board.renderChanged = true;
                          }
              Severity: Major
              Found in src/assets/js/games/blockrain/blockrain.jquery.js and 1 other location - About 1 hr to fix
              src/assets/js/games/blockrain/blockrain.jquery.js on lines 499..504

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

              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