LearnPAd/learnpad

View on GitHub
lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/yui/ext-yui-adapter-debug.js

Summary

Maintainability
F
1 mo
Test Coverage

File ext-yui-adapter-debug.js has 798 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.4.0
 * Copyright(c) 2006-2011 Sencha Inc.
 * licensing@sencha.com
 * http://www.sencha.com/license

    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,

    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 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 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){

        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 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){

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

                  formRequest : function(form, uri, cb, data, isUpload, sslUri){

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

                    color : function(el, args, duration, easing, cb, scope){

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

                      scroll : function(el, args, duration, easing, cb, scope){

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

                        motion : function(el, args, duration, easing, cb, scope){

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

                          on : function(el, eventName, fn, scope, override){

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

                            request : function(method, uri, cb, data, options){

                          Avoid too many return statements within this function.
                          Open

                                              return el;

                            Avoid too many return statements within this function.
                            Open

                                                return e;

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

                              (function(){
                                  var idSeed = 0,
                                      toString = Object.prototype.toString,
                                      ua = navigator.userAgent.toLowerCase(),
                                      check = function(r){
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/ext/ext-base-debug.js on lines 50..842
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 50..842
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 50..842

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

                              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,
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/ext/ext-base-debug.js on lines 1105..1225
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 1105..1225
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 1105..1225

                              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

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

                                  getXY : function(el){
                                      var p, pe, b, scroll, bd = (document.body || document.documentElement);
                                      el = Ext.getDom(el);
                              
                                      if(el == bd){
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 1299..1366

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

                              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.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:
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/ext/ext-base-debug.js on lines 852..1008
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 852..1008
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 852..1008

                              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
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/ext/ext-base-debug.js on lines 1040..1071
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 1040..1071
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 1040..1071

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

                                  setXY : function(el, xy){
                                      el = Ext.fly(el, '_setXY');
                                      el.position();
                                      var pts = el.translatePoints(xy);
                                      if(xy[0] !== false){
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 1368..1378

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

                              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((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){
                                          var item = mouseCache[el.id] || (mouseCache[el.id] = {});
                                          item[eventName] = fn;
                                          fn = fn.createInterceptor(checkRelatedTarget);
                                          eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout';
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 1480..1485

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

                              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((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){
                                          var item = mouseCache[el.id], 
                                              ev = item && item[eventName];
                              
                                          if(ev){
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 1490..1499

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

                              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.apply = function(o, c, defaults){
                                  // no "this" reference for friendly out of scope calls
                                  if(defaults){
                                      Ext.apply(o, defaults);
                                  }
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/ext/ext-base-debug.js on lines 37..48
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 37..48
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.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

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

                                      elContains = function(parent, child){
                                          if(parent && parent.firstChild){
                                              while(child){
                                                  if(child === parent){
                                                      return true;
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 1251..1264

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

                              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(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>
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/ext/ext-base-debug.js on lines 1014..1035
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/jquery/ext-jquery-adapter-debug.js on lines 1014..1035
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/adapter/prototype/ext-prototype-adapter-debug.js on lines 1014..1035

                              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