talho/openphin

View on GitHub
app/assets/javascripts/searches/AdvancedSearch.js

Summary

Maintainability
D
2 days
Test Coverage

Function panelLoaded has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    panelLoaded: function(panel){
        var link_elem_style = {'margin-bottom': '15px'};

        var wildcard_explanation = panel.getEl().select('.search_user_explanation').first();
        if(wildcard_explanation)
Severity: Major
Found in app/assets/javascripts/searches/AdvancedSearch.js - About 2 hrs to fix

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

        constructor: function(config)
        {
            Ext.apply(this, config);
    
            Talho.AdvancedSearch.superclass.constructor.call(this, config);
    Severity: Major
    Found in app/assets/javascripts/searches/AdvancedSearch.js and 1 other location - About 5 hrs to fix
    app/assets/javascripts/admin/PendingRoleRequests.js on lines 7..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 144.

    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

                var wildcard_panel = new Ext.Panel({
                    contentEl:wildcard_explanation.dom,
                    collapsed: true,
                    border: false,
                    listeners: {
    Severity: Major
    Found in app/assets/javascripts/searches/AdvancedSearch.js and 1 other location - About 3 hrs to fix
    app/assets/javascripts/searches/AdvancedSearch.js on lines 71..76

    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

                var advanced_search_panel = new Ext.Panel({contentEl: advanced_search.dom, collapsed: true, border: false,
                    listeners: {
                        'expand': function(){this.getPanel().doLayout();},
                        'collapse': function(){this.getPanel().doLayout();},
                        scope: this
    Severity: Major
    Found in app/assets/javascripts/searches/AdvancedSearch.js and 1 other location - About 3 hrs to fix
    app/assets/javascripts/searches/AdvancedSearch.js on lines 36..45

    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

                advanced_search_btn.on('click', function(){
                    quick_search_btn.show();
                    advanced_search_btn.hide();
                    quick_search_panel.collapse();
                    advanced_search_panel.expand();
    Severity: Major
    Found in app/assets/javascripts/searches/AdvancedSearch.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/searches/AdvancedSearch.js on lines 81..86

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

    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

                quick_search_btn.on('click', function(){
                    quick_search_btn.hide();
                    advanced_search_btn.show();
                    quick_search_panel.expand();
                    advanced_search_panel.collapse();
    Severity: Major
    Found in app/assets/javascripts/searches/AdvancedSearch.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/searches/AdvancedSearch.js on lines 88..93

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

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

    Talho.AdvancedSearch.initialize = function(config)
    {
        var as = new Talho.AdvancedSearch(config);
        return as.getPanel();
    };
    Severity: Major
    Found in app/assets/javascripts/searches/AdvancedSearch.js and 14 other locations - About 35 mins to fix
    app/assets/javascripts/admin/AddUser.js on lines 83..86
    app/assets/javascripts/admin/AuditLog.js on lines 236..239
    app/assets/javascripts/admin/BatchUsers.js on lines 213..216
    app/assets/javascripts/admin/EditUsers.js on lines 182..185
    app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
    app/assets/javascripts/dashboard/tutorials.js on lines 35..39
    app/assets/javascripts/documents/Documents.js on lines 491..494
    app/assets/javascripts/invitations/Invitations.js on lines 413..416
    app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
    app/assets/javascripts/profile/EditDevices.js on lines 47..50
    app/assets/javascripts/profile/EditPassword.js on lines 24..27
    app/assets/javascripts/profile/EditProfile.js on lines 139..142
    app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
    app/assets/javascripts/profile/ManageRoles.js on lines 48..51

    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

    There are no issues that match your filters.

    Category
    Status