talho/openphin

View on GitHub
app/assets/javascripts/ext/src/widgets/PagingToolbar.js

Summary

Maintainability
D
1 day
Test Coverage

Function initComponent has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initComponent : function(){
        var pagingItems = [this.first = new T.Button({
            tooltip: this.firstText,
            overflowText: this.firstText,
            iconCls: 'x-tbar-page-first',
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js - About 2 hrs to fix

    File PagingToolbar.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Ext JS Library 3.3.0
     * Copyright(c) 2006-2010 Ext JS, Inc.
     * licensing@extjs.com
     * http://www.extjs.com/license
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js - About 2 hrs to fix

      Function bindStore has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          bindStore : function(store, initial){
              var doLoad;
              if(!initial && this.store){
                  if(store !== this.store && this.store.autoDestroy){
                      this.store.destroy();
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js - About 1 hr to fix

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

                    if(store !== this.store && this.store.autoDestroy){
                        this.store.destroy();
                    }else{
                        this.store.un('beforeload', this.beforeLoad, this);
                        this.store.un('load', this.onLoad, this);
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/ext/src/widgets/form/Combo.js on lines 695..701

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

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

                }), this.last = new T.Button({
                    tooltip: this.lastText,
                    overflowText: this.lastText,
                    iconCls: 'x-tbar-page-last',
                    disabled: true,
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 3 other locations - About 1 hr to fix
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 201..208
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 208..215
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 230..237

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

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

                }), this.prev = new T.Button({
                    tooltip: this.prevText,
                    overflowText: this.prevText,
                    iconCls: 'x-tbar-page-prev',
                    disabled: true,
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 3 other locations - About 1 hr to fix
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 201..208
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 230..237
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 237..244

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

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

                }), '-', this.next = new T.Button({
                    tooltip: this.nextText,
                    overflowText: this.nextText,
                    iconCls: 'x-tbar-page-next',
                    disabled: true,
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 3 other locations - About 1 hr to fix
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 201..208
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 208..215
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 237..244

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

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

                var pagingItems = [this.first = new T.Button({
                    tooltip: this.firstText,
                    overflowText: this.firstText,
                    iconCls: 'x-tbar-page-first',
                    disabled: true,
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 3 other locations - About 1 hr to fix
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 208..215
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 230..237
        app/assets/javascripts/ext/src/widgets/PagingToolbar.js on lines 237..244

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

        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

                this.cursor = (o.params && o.params[p.start]) ? o.params[p.start] : 0;
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 1 other location - About 40 mins to fix
        app/assets/javascripts/ext_extensions/PagingStore.js on lines 472..472

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

                }else if (k == e.UP || k == e.PAGEUP || k == e.DOWN || k == e.PAGEDOWN){
                    e.stopEvent();
                    if((pageNum = this.readPage(d))){
                        var increment = e.shiftKey ? 10 : 1;
                        if(k == e.DOWN || k == e.PAGEDOWN){
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/PagingToolbar.js and 1 other location - About 35 mins to fix
        app/assets/javascripts/ext/src/widgets/Component.js on lines 1754..1759

        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