YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js

Summary

Maintainability
D
2 days
Test Coverage

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

        registerSubmitEvent() {
            this.container.off('submit').on('submit', (e) => {
                e.preventDefault();
                this.container.find('.js-toggle-panel').find('.js-block-content').removeClass('d-none');
                if ($(e.currentTarget).validationEngine('validate')) {

    Function preSaveValidation has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            preSaveValidation: function () {
                const aDeferred = $.Deferred();
                let formData = new FormData(this.container[0]);
                formData.append('mode', 'preSaveValidation');
                AppConnector.request({

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

              registerBlockToggleEvent() {
                  this.container.on('click', '.blockHeader', function (e) {
                      const target = $(e.target);
                      if (
                          target.is('input') ||
      public_html/layouts/basic/modules/Settings/PickListDependency/resources/Edit.js on lines 175..198

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

      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

                          for (var key in this.conditionBuilders) {
                              this.container
                                  .find(`input[name="${key}"]`)
                                  .val(JSON.stringify(this.conditionBuilders[key].getConditions()));
                          }
      public_html/layouts/basic/modules/Settings/PickListDependency/resources/Edit.js on lines 51..53

      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

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

                  AppConnector.request({
                      async: false,
                      url: 'index.php',
                      type: 'POST',
                      data: formData,
      public_html/layouts/basic/modules/Settings/Picklist/resources/Index.js on lines 367..391
      public_html/layouts/basic/modules/Vtiger/resources/RecordAddsTemplates.js on lines 30..72

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

      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

                                      .fail(function () {
                                          document.progressLoader.progressIndicator({ mode: 'hide' });
                                          app.showNotify({ text: app.vtranslate('JS_ERROR'), type: 'error' });
                                      });
      public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 75..78

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

      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

                                          } else {
                                              document.progressLoader.progressIndicator({ mode: 'hide' });
                                              app.showNotify({ text: app.vtranslate('JS_ERROR'), type: 'error' });
                                          }
      public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 80..83

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

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

                          document.progressLoader = $.progressIndicator({
                              message: app.vtranslate('JS_SAVE_LOADER_INFO'),
                              position: 'html',
                              blockInfo: {
                                  enabled: true
      public_html/layouts/basic/modules/Settings/Groups/resources/Edit.js on lines 30..34
      public_html/layouts/basic/modules/Users/resources/SwitchUsers.js on lines 35..41
      public_html/layouts/basic/modules/Users/resources/SwitchUsers.js on lines 49..55
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 95..101
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 921..927
      public_html/layouts/basic/modules/Vtiger/resources/Edit.js on lines 965..971
      public_html/layouts/basic/modules/Vtiger/resources/GenerateModal.js on lines 11..17
      public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 52..58

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 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

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

              getContainer: function () {
                  if (this.container == false) {
                      this.container = jQuery('div.contentsDiv form');
                  }
                  return this.container;
      public_html/layouts/basic/modules/Project/resources/GanttController.js on lines 9..14
      public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/List.js on lines 30..35
      public_html/layouts/basic/modules/Settings/BruteForce/resources/Index.js on lines 9..14
      public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 170..175
      public_html/layouts/basic/modules/Settings/Notifications/resources/Configuration.js on lines 98..103
      public_html/layouts/basic/modules/Settings/PickListDependency/resources/List.js on lines 28..33
      public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 10..15
      public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 578..583
      public_html/layouts/basic/modules/Vtiger/resources/Export.js on lines 9..14
      public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 73..78
      public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 79..84
      public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 85..90
      public_html/layouts/basic/modules/Vtiger/resources/Inventory.js on lines 91..96
      public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 495..500
      public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 501..506
      public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 507..512
      public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 524..529
      public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 266..271
      public_html/layouts/basic/modules/Vtiger/resources/TreeCategoryModal.js on lines 12..17
      public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 11..16

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

      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

      There are no issues that match your filters.

      Category
      Status