YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
D
2 days
Test Coverage

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

    registerSaveEvent: function (mode, data) {
        let progress = $.progressIndicator({
            message: app.vtranslate('Saving changes'),
            position: 'html',
            blockInfo: {

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

                jQuery(this)
                    .find('tbody')
                    .sortable({
                        containment: '#modulesEntity',
                        revert: true,
    public_html/layouts/basic/modules/Settings/CustomView/resources/Index.js on lines 96..114

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

    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

            AppConnector.request(params)
                .done(function (data) {
                    progressIndicatorElement.progressIndicator({ mode: 'hide' });
                    var params = {};
                    params['text'] = app.vtranslate('JS_MODULES_SEQUENCE_UPDATED');
    public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 71..80

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

    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

            editModules.each(function (i, domElement) {
                var moduleEle = jQuery(domElement);
                var moduleId = moduleEle.data('tabid');
                thisInstance.updatedBlockFieldsList.push({
                    tabid: moduleId,
    public_html/layouts/basic/modules/Settings/QuickCreateEditor/resources/QuickCreateEditor.js on lines 100..108
    public_html/layouts/basic/modules/Settings/QuickCreateEditor/resources/QuickCreateEditor.js on lines 112..120

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

    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

        registerModuleSequenceSaveClick: function () {
            var thisInstance = this;
            var layout = jQuery('.SearchFieldsEdit');
            layout.on('click', '.saveModuleSequence', function () {
                thisInstance.hideSaveModuleSequenceButton();
    public_html/layouts/basic/modules/Settings/QuickCreateEditor/resources/QuickCreateEditor.js on lines 167..175

    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

        showSaveModuleSequenceButton: function () {
            var thisInstance = this;
            var layout = jQuery('.SearchFieldsEdit');
            var saveButton = layout.find('.saveModuleSequence');
            thisInstance.updatedBlockFieldsList = [];
    public_html/layouts/basic/modules/Settings/QuickCreateEditor/resources/QuickCreateEditor.js on lines 53..59

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

    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

            Settings_Index_Js.validate(e).done(function (target) {
                Settings_Index_Js.registerSaveEvent('save', {
                    name: target.attr('name'),
                    value: target.val(),
                    tabid: target.data('tabid')
    public_html/layouts/basic/modules/Settings/Search/resources/Search.js on lines 41..47

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

    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

                sortableCb: (currentSelect) => {
                    Settings_Index_Js.registerSaveEvent('save', {
                        name: currentSelect.attr('name'),
                        value: currentSelect.val(),
                        tabid: currentSelect.data('tabid')
    public_html/layouts/basic/modules/Settings/Search/resources/Search.js on lines 72..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 55.

    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

            params.data = {
                module: app.getModuleName(),
                parent: app.getParentModuleName(),
                action: 'SaveAjax',
                mode: mode,
    public_html/layouts/basic/modules/Settings/Calendar/resources/UserColors.js on lines 30..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 51.

    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

        hideSaveModuleSequenceButton: function () {
            var layout = jQuery('.SearchFieldsEdit');
            var saveButton = layout.find('.saveModuleSequence');
            saveButton.addClass('d-none');
        },
    public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 515..519
    public_html/layouts/basic/modules/Settings/QuickCreateEditor/resources/QuickCreateEditor.js on lines 64..68

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

            let progress = $.progressIndicator({
                message: app.vtranslate('Saving changes'),
                position: 'html',
                blockInfo: {
                    enabled: true
    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/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/PDF.js on lines 9..15
    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