YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Vtiger/resources/PDF.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function registerListViewCheckRecords has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    registerListViewCheckRecords(container) {
        let templateElements = container.find('[name="pdf_template[]"]');
        templateElements.on('change', function () {
            document.progressLoader = $.progressIndicator({
                message: app.vtranslate('JS_PDF_RECALCULATING'),
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js - About 1 hr to fix

    Function registerSaveInventoryColumnSchemeClick has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        registerSaveInventoryColumnSchemeClick() {
            this.container.find('.js-save-scheme').on('click', (e) => {
                e.preventDefault();
                e.stopPropagation();
                const loader = $.progressIndicator({
    Severity: Minor
    Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js - About 1 hr to fix

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

                  case 'email_pdf':
                      this.container.find('[name="email_pdf"]').val(1);
                      this.container.find('#pdfExportModal').submit();
                      break;
      Severity: Minor
      Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js and 1 other location - About 45 mins to fix
      public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 20..23

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

                  case 'single_pdf':
                      this.container.find('[name="single_pdf"]').val(1);
                      this.container.find('#pdfExportModal').submit();
                      break;
      Severity: Minor
      Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js and 1 other location - About 45 mins to fix
      public_html/layouts/basic/modules/Vtiger/resources/PDF.js on lines 24..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 50.

      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_PDF_RECALCULATING'),
                      position: 'html',
                      blockInfo: {
                          enabled: true
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js and 8 other locations - About 40 mins to fix
      public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 53..59
      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

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

                  templateElements.filter(':checked').each(function () {
                      templates.push($(this).val());
                  });
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js and 7 other locations - About 35 mins to fix
      public_html/layouts/basic/modules/Settings/TwoFactorAuthentication/resources/Index.js on lines 57..59
      public_html/layouts/basic/modules/Settings/Wapro/resources/List.js on lines 51..53
      public_html/layouts/basic/modules/Settings/WidgetsManagement/resources/WidgetsManagement.js on lines 206..208
      public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2101..2103
      public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2139..2141
      public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 2143..2145
      public_html/layouts/resources/Calendar.js on lines 351..353

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

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

              const loader = $.progressIndicator({
                  message: app.vtranslate('JS_PDF_GENERATING'),
                  position: 'html',
                  blockInfo: {
                      enabled: true
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/PDF.js and 13 other locations - About 30 mins to fix
      public_html/layouts/basic/modules/Settings/ConfReport/resources/Index.js on lines 13..19
      public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1729..1735
      public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1947..1953
      public_html/layouts/basic/modules/Settings/Search/resources/Search.js on lines 81..87
      public_html/layouts/basic/modules/Settings/Widgets/resources/Widgets.js on lines 98..104
      public_html/layouts/basic/modules/Settings/WidgetsManagement/resources/WidgetsManagement.js on lines 526..532
      public_html/layouts/basic/modules/Users/resources/Edit.js on lines 110..116
      public_html/layouts/basic/modules/Users/resources/List.js on lines 200..206
      public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 1881..1887
      public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1922..1928
      public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 888..894
      public_html/layouts/resources/app.js on lines 250..256
      public_html/layouts/resources/app.js on lines 440..446

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

      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