YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js

Summary

Maintainability
F
4 days
Test Coverage

Function registerEvents has 201 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerEvents: function () {
            const thisIstance = this,
                container = jQuery('.contentsDiv');
            thisIstance.registerColorField($('#exceptions select'));
            thisIstance.registerEditFolders(container);

    File Index.js has 441 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
    'use strict';
    
    jQuery.Class(
        'Settings_OSSMailScanner_Index_Js',

      Function reloadLogTable has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              reloadLogTable: function (page) {
                  const self = this;
                  let container = $('.contentsDiv'),
                      limit = 30;
                  AppConnector.request({

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

                registerEditFolders: function (container) {
                    const self = this;
                    container.find('.js-edit-folders').on('click', (e) => {
                        let element = $(e.currentTarget);
                        let userContainer = element.closest('td');

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

                      AppConnector.request({
                          module: 'OSSMailScanner',
                          action: 'SaveEmailSearchList',
                          vale: vale
                      }).done(function (data) {
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 287..305
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 308..327
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 368..387

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

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

                      AppConnector.request({
                          module: 'OSSMailScanner',
                          action: 'SaveWidgetConfig',
                          conf_type: type,
                          name: name,
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 287..305
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 308..327
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 336..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 86.

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

                      AppConnector.request({
                          module: 'OSSMailScanner',
                          action: 'SaveCRMuser',
                          mode: 'user',
                          userid: userid,
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 287..305
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 336..353
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 368..387

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

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

                      AppConnector.request({
                          module: 'OSSMailScanner',
                          action: 'SaveActions',
                          userid: userid,
                          vale: vale
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 308..327
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 336..353
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 368..387

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

          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

                      jQuery("select[id^='user_list_']").on('change', function () {
                          thisIstance.saveCRMuser(jQuery(this).data('user'), jQuery(this).val());
                      });
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 196..198
          public_html/layouts/basic/modules/Settings/Password/resources/Password.js 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 56.

          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

                      jQuery("select[id^='function_list_']").on('change', function () {
                          thisIstance.saveActions(jQuery(this).data('user-id'), jQuery(this).val());
                      });
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 199..201
          public_html/layouts/basic/modules/Settings/Password/resources/Password.js 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 56.

          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

                              function (data) {
                                  if (data.success) {
                                      app.showNotify({
                                          text: data.result.data,
                                          type: 'info'
          public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 129..133

          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

                      jQuery('#tab_email_view_open_window').on('change', function () {
                          thisIstance.saveWidgetConfig('target', jQuery(this).val(), 'email_list');
                      });
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 205..207

          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

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

                      jQuery('#tab_email_view_widget_limit').on('blur', function () {
                          thisIstance.saveWidgetConfig('widget_limit', jQuery(this).val(), 'email_list');
                      });
          public_html/layouts/basic/modules/Settings/OSSMailScanner/resources/Index.js on lines 208..210

          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