talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

    constructor : function(element, config) {
        Ext.apply(this, config);
        Ext.ux.Tabs.superclass.constructor.call(this);
        
        this.addEvents(
app/assets/javascripts/ext/src/ext-core/examples/rating/rating.js on lines 19..30

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

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

        for(var i = 0; i < fl; i++){
            f = fi[i];
            var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
            ef.push(this.createAccessor(map));
        }
Severity: Major
Found in app/assets/javascripts/ext/src/data/XmlReader.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/ext/src/data/JsonReader.js on lines 282..286

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

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

    updateScrollButtons : function(){
        var pos = this.getScrollPos();
        this.scrollLeft[pos === 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled');
        this.scrollRight[pos >= (this.getScrollWidth()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled');
    },
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 907..911

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

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

    updateScrollButtons : function(){
        var pos = this.getScrollPos();
        this.scrollTop[pos === 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled');
        this.scrollBottom[pos >= (this.getScrollHeight()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled');
    },
app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 1034..1038

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

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(element, config) {
        Ext.apply(this, config);
        Ext.ux.Rating.superclass.constructor.call(this);
        
        this.addEvents(
app/assets/javascripts/ext/src/ext-core/examples/tabs/tabs.js on lines 14..25

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

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

        for(var i = 0; i < fl; i++){
            f = fi[i];
            var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
            ef.push(this.createAccessor(map));
        }
Severity: Major
Found in app/assets/javascripts/ext/src/data/JsonReader.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/ext/src/data/XmlReader.js on lines 199..203

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

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(axy[1]+sz.height > dh){
                    if(this.anchorToTarget){
                        this.defaultAlign = 'b-t';
                        if(this.mouseOffset){this.mouseOffset[1] *= -1;}
                    }
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/ext/src/widgets/tips/ToolTip.js on lines 214..221

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

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(axy[0]+sz.width > dw){
                    if(this.anchorToTarget){
                        this.defaultAlign = 'r-l';
                        if(this.mouseOffset){this.mouseOffset[0] *= -1;}
                    }
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/ext/src/widgets/tips/ToolTip.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 94.

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

File NewInvitation.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//= require_self

Ext.ns("Talho");

Talho.NewInvitation = Ext.extend(Talho.NewInvitationBase, {
Severity: Minor
Found in app/assets/javascripts/invitations/NewInvitation.js - About 2 hrs to fix

    Function TaskRunner has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Ext.util.TaskRunner = function(interval){
        interval = interval || 10;
        var tasks = [], 
            removeQueue = [],
            id = 0,
    Severity: Major
    Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 2 hrs to fix

      Function slideIn has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          slideIn : function(anchor, o){ 
              o = getObject(o);
              var me = this,
                  dom = me.dom,
                  st = dom.style,
      Severity: Major
      Found in app/assets/javascripts/ext/src/ext-core/src/core/Fx.js - About 2 hrs to fix

        Function TaskRunner has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Ext.util.TaskRunner = function(interval){
            interval = interval || 10;
            var tasks = [], 
                removeQueue = [],
                id = 0,
        Severity: Major
        Found in app/assets/javascripts/ext/src/ext-core/src/util/TaskMgr.js - About 2 hrs to fix

          Function TaskRunner has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Ext.util.TaskRunner = function(interval){
              interval = interval || 10;
              var tasks = [], 
                  removeQueue = [],
                  id = 0,
          Severity: Major
          Found in app/assets/javascripts/ext/adapter/ext/ext-base-debug.js - About 2 hrs to fix

            Function TaskRunner has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Ext.util.TaskRunner = function(interval){
                interval = interval || 10;
                var tasks = [], 
                    removeQueue = [],
                    id = 0,

              Function TaskRunner has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Ext.util.TaskRunner = function(interval){
                  interval = interval || 10;
                  var tasks = [], 
                      removeQueue = [],
                      id = 0,
              Severity: Major
              Found in app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js - About 2 hrs to fix

                Function appendChild has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    appendChild : function(node){
                        var multi = false;
                        if(Ext.isArray(node)){
                            multi = node;
                        }else if(arguments.length > 1){
                Severity: Minor
                Found in app/assets/javascripts/ext/src/data/Tree.js - About 2 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 loadRecords has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    loadRecords : function(o, options, success){
                        var i;
                        
                        if (this.isDestroyed === true) {
                            return;
                Severity: Minor
                Found in app/assets/javascripts/ext/src/data/Store.js - About 2 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 bindStore has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    bindStore : function(store, initial){
                        if(this.store && !initial){
                            if(this.store !== store && this.store.autoDestroy){
                                this.store.destroy();
                            }else{
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/form/Combo.js - About 2 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 renderItem has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    renderItem : function(c, position, target){
                        if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
                            var args = this.getTemplateArgs(c);
                            if(Ext.isNumber(position)){
                                position = target.dom.childNodes[position] || null;
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/layout/FormLayout.js - About 2 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 insertRows has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    insertRows : function(dm, firstRow, lastRow, isUpdate) {
                        var last = dm.getCount() - 1;
                        if( !isUpdate && firstRow === 0 && lastRow >= last) {
                            this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
                                this.refresh();
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 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

                Severity
                Category
                Status
                Source
                Language