fairplaysk/datacamp

View on GitHub

Showing 277 of 350 total issues

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

    html: function( value ) {
        if ( value === undefined ) {
            return this[0] && this[0].nodeType === 1 ?
                this[0].innerHTML.replace(rinlinejQuery, "") :
                null;
Severity: Minor
Found in app/assets/javascripts/jquery.js - About 1 hr to fix

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

        cleanData: function( elems ) {
            var data, id, cache = jQuery.cache,
                special = jQuery.event.special,
                deleteExpando = jQuery.support.deleteExpando;
            
    Severity: Minor
    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

      Method searched_datasets has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def searched_datasets
          datasets = DatasetDescription.where(:is_active => true)
          
          Rails.logger.info "search: find datasets"
      
      
      Severity: Minor
      Found in app/models/search_query.rb - About 1 hr to fix

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

            addClass: function( value ) {
                if ( jQuery.isFunction(value) ) {
                    return this.each(function(i) {
                        var self = jQuery(this);
                        self.addClass( value.call(this, i, self.attr("class")) );
        Severity: Minor
        Found in app/assets/javascripts/jquery.js - About 1 hr to fix

          Method parse_address has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def parse_address(full_address)
                  zip = place = ''
                  items = full_address.split(',')
                  if items.size < 3
                    address = items[0]
          Severity: Minor
          Found in lib/etl/shared/vvo_includes.rb - About 1 hr to fix

            Method digest_founders has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def digest_founders(table)
                    founders = []
                    table.xpath(".//tr").each do |founder_row|
                      founder_identification = founder_row.xpath(".//td[1]").inner_text.strip.split("\n")
                      founder_contribution = founder_row.xpath(".//td[3]").inner_text[1..-2].strip.split(' ')
            Severity: Minor
            Found in lib/etl/foundation_extraction.rb - About 1 hr to fix

              Function toggleClass has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  toggleClass: function( value, stateVal ) {
                      var type = typeof value,
                          isBool = typeof stateVal === "boolean";
              
                      if ( jQuery.isFunction( value ) ) {
              Severity: Minor
              Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                Function type has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    jQuery.fn[ type ] = function( size ) {
                        // Get window width or height
                        var elem = this[0];
                        if ( !elem ) {
                            return size == null ? null : this;
                Severity: Minor
                Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                  Function > has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          ">": function( checkSet, part ) {
                              var elem,
                                  isPartStr = typeof part === "string",
                                  i = 0,
                                  l = checkSet.length;
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                    Method create_resources has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def create_resources(resource_type, resources, attributes)
                          all_ids = resources.map(&:_record_id)
                          active_objects = []
                          attributes.each do |obj_hash|
                            case resource_type
                    Severity: Minor
                    Found in lib/etl/foundation_extraction.rb - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
                              !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
                      
                              cacheable = true;
                              cacheresults = jQuery.fragments[ args[0] ];
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                        Method add_to_sphinx_search has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def add_to_sphinx_search(operand, sphinx_search)
                          options = {with: {}, without: {}}
                          operand ||= "*"
                          
                          case operator
                        Severity: Minor
                        Found in app/models/search_predicate.rb - 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

                        Method customer_information has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def customer_information(document)
                              customer_information_hash = {}
                        
                              case document_type(document)
                                when :standard
                        Severity: Minor
                        Found in lib/etl/vvo_extraction.rb - 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

                        Avoid deeply nested control flow statements.
                        Open

                                                if ( jQuery.isPlainObject( context ) ) {
                                                    selector = [ document.createElement( ret[1] ) ];
                                                    jQuery.fn.attr.call( selector, context, true );
                        
                                                } else {
                        Severity: Major
                        Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
                                                      ret.push({ selector: selector, elem: cur, level: level });
                                                  }
                          Severity: Major
                          Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if ( display === "inline" ) {
                                                            this.style.display = "inline-block";
                            
                                                        } else {
                                                            this.style.display = "inline";
                            Severity: Major
                            Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if ( copyIsArray ) {
                                                      copyIsArray = false;
                                                      clone = src && jQuery.isArray(src) ? src : [];
                              
                                                  } else {
                              Severity: Major
                              Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ( ret === false ) {
                                                            event.preventDefault();
                                                            event.stopPropagation();
                                                        }
                                Severity: Major
                                Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
                                                          if ( item ) {
                                                              found = filter( item, match, i, curLoop );
                                                              var pass = not ^ !!found;
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if ( !isXML ) {
                                                            elem.sizcache = doneName;
                                                            elem.sizset = i;
                                                        }
                                    Severity: Major
                                    Found in app/assets/javascripts/jquery.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language