talho/openphin

View on GitHub
app/assets/javascripts/ext/src/dd/DragSource.js

Summary

Maintainability
B
5 hrs
Test Coverage

`` has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {
    /**
     * @cfg {String} ddGroup
     * A named drag drop group to which this object belongs.  If a group is specified, then this object will only
     * interact with other drag drop objects in the same group (defaults to undefined).
Severity: Minor
Found in app/assets/javascripts/ext/src/dd/DragSource.js - About 3 hrs to fix

    Function onDragDrop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        onDragDrop : function(e, id){
            var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);
            if(this.beforeDragDrop(target, e, id) !== false){
                if(target.isNotifyTarget){
                    if(target.notifyDrop(this, e, this.dragData)){ // valid drop?
    Severity: Minor
    Found in app/assets/javascripts/ext/src/dd/DragSource.js - About 1 hr 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 onDragOver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        onDragOver : function(e, id){
            var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);
            if(this.beforeDragOver(target, e, id) !== false){
                if(target.isNotifyTarget){
                    var status = target.notifyOver(this, e, this.dragData);
    Severity: Minor
    Found in app/assets/javascripts/ext/src/dd/DragSource.js - About 25 mins 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 onDragEnter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        onDragEnter : function(e, id){
            var target = Ext.dd.DragDropMgr.getDDById(id);
            this.cachedTarget = target;
            if(this.beforeDragEnter(target, e, id) !== false){
                if(target.isNotifyTarget){
    Severity: Minor
    Found in app/assets/javascripts/ext/src/dd/DragSource.js - About 25 mins 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

    There are no issues that match your filters.

    Category
    Status