talho/openphin

View on GitHub
app/assets/javascripts/ext/src/util/MixedCollection.js

Summary

Maintainability
D
1 day
Test Coverage

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

Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, {

    /**
     * @cfg {Boolean} allowFunctions Specify <tt>true</tt> if the {@link #addAll}
     * function should add function references to the collection. Defaults to
Severity: Minor
Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 4 hrs to fix

    File MixedCollection.js has 321 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/util/MixedCollection.js - About 3 hrs to fix

      Function addAll has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          addAll : function(objs){
              if(arguments.length > 1 || Ext.isArray(objs)){
                  var args = arguments.length > 1 ? arguments : objs;
                  for(var i = 0, len = args.length; i < len; i++){
                      this.add(args[i]);
      Severity: Minor
      Found in app/assets/javascripts/ext/src/util/MixedCollection.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 _sort has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _sort : function(property, dir, fn){
              var i, len,
                  dsc   = String(dir).toUpperCase() == 'DESC' ? -1 : 1,
      
                  //this is a temporary array used to apply the sorting function
      Severity: Minor
      Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 1 hr to fix

        Function createValueMatcher has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            createValueMatcher : function(value, anyMatch, caseSensitive, exactMatch) {
                if (!value.exec) { // not a regex
                    var er = Ext.escapeRe;
                    value = String(value);
        
        
        Severity: Minor
        Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 55 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 getRange has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            getRange : function(start, end){
                var items = this.items;
                if(items.length < 1){
                    return [];
                }
        Severity: Minor
        Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 45 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 findIndex has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            findIndex : function(property, value, start, anyMatch, caseSensitive){
        Severity: Minor
        Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 35 mins to fix

          Function reorder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              reorder: function(mapping) {
                  this.suspendEvents();
          
                  var items = this.items,
                      index = 0,
          Severity: Minor
          Found in app/assets/javascripts/ext/src/util/MixedCollection.js - About 35 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