talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

    getTemplateArgs : function(item) {
        var cls = item.closable ? 'x-tab-strip-closable' : '';
        if(item.disabled){
            cls += ' x-item-disabled';
        }
app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 565..583

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

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

Function render has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    render : function(container, position){
        if(!this.rendered && this.fireEvent('beforerender', this) !== false){
            if(!container && this.el){
                this.el = Ext.get(this.el);
                container = this.el.dom.parentNode;
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/Component.js - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function createToolbar has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    createToolbar : function(editor){
        var items = [];
        var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled();


Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/form/HtmlEditor.js - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        if(this.enableGroupingMenu && this.hmenu){
            this.hmenu.add('-',{
                itemId:'groupBy',
                text: this.groupByText,
                handler: this.onGroupByClick,
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/grid/GroupingView.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/ext/src/widgets/grid/GroupingView.js on lines 394..414

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

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

        if (this.enableGroupingMenu && this.hmenu) {
            this.hmenu.add('-',{
                itemId:'groupBy',
                text: this.groupByText,
                handler: this.onGroupByClick,
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/grid/GroupingView.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/ext/src/widgets/grid/GroupingView.js on lines 242..260

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

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

Window has 42 functions (exceeds 20 allowed). Consider refactoring.
Open

Ext.Window = Ext.extend(Ext.Panel, {
    /**
     * @cfg {Number} x
     * The X position of the left edge of the window on initial showing. Defaults to centering the Window within
     * the width of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/Window.js - About 5 hrs to fix

    Button has 42 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.Button = Ext.extend(Ext.BoxComponent, {
        /**
         * Read-only. True if this button is hidden
         * @type Boolean
         */
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/Button.js - About 5 hrs to fix

      Function addBinding has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          addBinding : function(config){
              if(Ext.isArray(config)){
                  Ext.each(config, function(c){
                      this.addBinding(c);
                  }, this);
      Severity: Minor
      Found in app/assets/javascripts/ext/src/util/KeyMap.js - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File DataView.js has 399 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/DataView.js - About 5 hrs to fix

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

            getLayoutTargetSize : function() {
                var target = this.container.getLayoutTarget(), ret;
                
                if (target) {
                    ret = target.getViewSize();
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/layout/BoxLayout.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/ext/src/widgets/layout/ColumnLayout.js on lines 83..99

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

        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

            getLayoutTargetSize : function() {
                var target = this.container.getLayoutTarget(), ret;
                if (target) {
                    ret = target.getViewSize();
        
        
        app/assets/javascripts/ext/src/widgets/layout/BoxLayout.js on lines 279..297

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

        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

        DataView has 41 functions (exceeds 20 allowed). Consider refactoring.
        Open

        Ext.DataView = Ext.extend(Ext.BoxComponent, {
            /**
             * @cfg {String/Array} tpl
             * The HTML fragment or an array of fragments that will make up the template used by this DataView.  This should
             * be specified in the same format expected by the constructor of {@link Ext.XTemplate}.
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/DataView.js - About 5 hrs to fix

          HtmlEditor has 41 functions (exceeds 20 allowed). Consider refactoring.
          Open

          Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
              /**
               * @cfg {Boolean} enableFormat Enable the bold, italic and underline buttons (defaults to true)
               */
              enableFormat : true,
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/form/HtmlEditor.js - About 5 hrs to fix

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

                                !tags.indexOf("<opt") &&
                                [ 1, "<select multiple='multiple'>", "</select>" ] ||
            
                                !tags.indexOf("<leg") &&
                                [ 1, "<fieldset>", "</fieldset>" ] ||
            Severity: Major
            Found in app/assets/javascripts/jquery.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 949..970

            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

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

            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

                                !tags.indexOf("<opt") &&
                                [ 1, "<select multiple='multiple'>", "</select>" ] ||
                                
                                !tags.indexOf("<leg") &&
                                [ 1, "<fieldset>", "</fieldset>" ] ||
            Severity: Major
            Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/jquery.js on lines 885..906

            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

                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

            Function initComponent has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                initComponent : function(){
                    Ext.form.ComboBox.superclass.initComponent.call(this);
                    this.addEvents(
                        /**
                         * @event expand
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/form/Combo.js - About 5 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                    if(this.disabledDates){
                        var dd = this.disabledDates,
                            len = dd.length - 1,
                            re = "(?:";
            
            
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/form/DateField.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 185..197

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

            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

                    if(!this.disabledDatesRE && this.disabledDates){
                        var dd = this.disabledDates,
                            len = dd.length - 1,
                            re = '(?:';
            
            
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/ext/src/widgets/form/DateField.js on lines 185..197

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

            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

            Severity
            Category
            Status
            Source
            Language