YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Project/resources/GanttController.js

Summary

Maintainability
C
1 day
Test Coverage

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

                App.Fields.Picklist.showSelect2ElementView(filterSelectElement, {
                    templateSelection: function (data) {
                        const resultContainer = document.createElement('span'),
                            span = document.createElement('span'),
                            image = $('.filterImage').clone();
public_html/layouts/basic/modules/Vtiger/resources/RecordsList.js on lines 313..326

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

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

        getSelectOptionFromChosenOption: function (liElement) {
            var id = liElement.attr('id');
            var idArr = id.split('-');
            var currentOptionId = '';
            if (idArr.length > 0) {
public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 784..794

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

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(urlParams)
                            .done(function (data) {
                                progressInstance.progressIndicator({ mode: 'hide' });
                                aDeferred.resolve(data);
                                app.notifyPostAjaxReady();
public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2923..2935

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

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('.filterActionsDiv')
                    .appendTo(select2Instance.$dropdown.find('.select2-dropdown:last'))
                    .removeClass('d-none')
                    .on('click', function (e) {
                        self.registerCreateFilterClickEvent(e);
public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1773..1778

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

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

        getFilterSelectElement: function () {
            if (this.filterSelectElement == false) {
                this.filterSelectElement = jQuery('#customFilter');
            }
            return this.filterSelectElement;
public_html/layouts/basic/modules/Settings/AutomaticAssignment/resources/Edit.js on lines 15..20
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