talho/openphin

View on GitHub
app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js

Summary

Maintainability
F
2 mos
Test Coverage

File ext-jquery-adapter-debug.js has 969 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: Major
Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 2 days to fix

    Function TaskRunner has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    Ext.util.TaskRunner = function(interval){
        interval = interval || 10;
        var tasks = [], 
            removeQueue = [],
            id = 0,
    Severity: Minor
    Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 4 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 Anim has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Ext.lib.Anim = function(){
        var createAnim = function(cb, scope){
            var animated = true;
            return {
                stop : function(skipToLast){
    Severity: Major
    Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 4 hrs to fix

      Function Ajax has 98 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Ext.lib.Ajax = function(){
          var createComplete = function(cb){
               return function(xhr, status){
                  if((status == 'error' || status == 'timeout') && cb.failure){
                      cb.failure.call(cb.scope||window, createResponse(cb, xhr));
      Severity: Major
      Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 3 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 run has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  run : function(el, args, duration, easing, cb, scope, type){
                      var anim = createAnim(cb, scope), e = Ext.fly(el, '_animrun');
                      var o = {};
                      for(var k in args){
                          switch(k){   // jquery doesn't support, so convert
          Severity: Major
          Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 2 hrs to fix

            Function getXY has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getXY : function(el) {
                    var p, pe, b, scroll, bd = (document.body || document.documentElement);
                    el = Ext.getDom(el);
            
                    if(el == bd){
            Severity: Minor
            Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 2 hrs to fix

              Function request has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      request : function(method, uri, cb, data, options){
                          var o = {
                              type: method,
                              url: uri,
                              data: data,

                Function extend has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        extend : function(){
                            // inline overrides
                            var io = function(o){
                                for(var m in o){
                                    this[m] = o[m];

                  Function createResponse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var createResponse = function(cb, xhr){
                          var headerObj = {},
                              headerStr,
                              t,
                              s;

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

                            runTasks = function(){
                                var rqLen = removeQueue.length,
                                    now = new Date().getTime();                                
                            
                                if(rqLen > 0){

                      Function run has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              run : function(el, args, duration, easing, cb, scope, type){
                      Severity: Major
                      Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 50 mins to fix

                        Function color has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                color : function(el, args, duration, easing, cb, scope){
                        Severity: Minor
                        Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 45 mins to fix

                          Function motion has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  motion : function(el, args, duration, easing, cb, scope){
                          Severity: Minor
                          Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 45 mins to fix

                            Function formRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    formRequest : function(form, uri, cb, data, isUpload, sslUri){
                            Severity: Minor
                            Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 45 mins to fix

                              Function scroll has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      scroll : function(el, args, duration, easing, cb, scope){
                              Severity: Minor
                              Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 45 mins to fix

                                Function on has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    on : function(el, eventName, fn, scope, override){
                                Severity: Minor
                                Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 35 mins to fix

                                  Function request has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          request : function(method, uri, cb, data, options){
                                  Severity: Minor
                                  Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 35 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                        return el;
                                    Severity: Major
                                    Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                          return e;
                                      Severity: Major
                                      Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 30 mins to fix

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

                                        (function(){
                                        var libFlyweight;
                                        
                                        Ext.lib.Dom = {
                                            getViewWidth : function(full){
                                        app/assets/javascripts/ext/src/adapter/jquery-bridge.js on lines 11..579

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

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

                                        (function(){
                                            var idSeed = 0,
                                                toString = Object.prototype.toString,
                                                ua = navigator.userAgent.toLowerCase(),
                                                check = function(r){
                                        app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 50..822
                                        app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 50..822
                                        app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 50..822
                                        app/assets/javascripts/ext/src/ext-core/src/core/Ext.js on lines 50..822

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

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

                                        Ext.util.TaskRunner = function(interval){
                                            interval = interval || 10;
                                            var tasks = [], 
                                                removeQueue = [],
                                                id = 0,
                                        app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 1085..1205
                                        app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 1085..1205
                                        app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 1085..1205

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

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

                                        Ext.apply(Function.prototype, {
                                             /**
                                             * Creates an interceptor function. The passed function is called before the original one. If it returns false,
                                             * the original one is not called. The resulting function returns the results of the original function.
                                             * The passed function is called with the parameters of the original function. Example usage:
                                        app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 832..988
                                        app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 832..988
                                        app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 832..988
                                        app/assets/javascripts/ext/src/ext-core/src/core/Ext.js on lines 832..988

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

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

                                        Ext.applyIf(Array.prototype, {
                                            /**
                                             * Checks whether or not the specified object exists in the array.
                                             * @param {Object} o The object to check for
                                             * @param {Number} from (Optional) The index at which to begin the search
                                        app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 1020..1051
                                        app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 1020..1051
                                        app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 1020..1051

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

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

                                        Ext.apply = function(o, c, defaults){
                                            // no "this" reference for friendly out of scope calls
                                            if(defaults){
                                                Ext.apply(o, defaults);
                                            }
                                        app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 37..48
                                        app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 37..48
                                        app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 37..48
                                        app/assets/javascripts/ext/src/ext-core/src/core/Ext.js on lines 37..48

                                        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

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

                                        Ext.applyIf(String, {
                                            /**
                                             * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
                                             * token must be unique, and must increment in the format {0}, {1}, etc.  Example usage:
                                             * <pre><code>
                                        app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 994..1015
                                        app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 994..1015
                                        app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 994..1015
                                        app/assets/javascripts/ext/src/ext-core/src/core/Ext.js on lines 994..1015

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

                                        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