Showing 277 of 350 total issues
Function html
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
html: function( value ) {
if ( value === undefined ) {
return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
Function cleanData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cleanData: function( elems ) {
var data, id, cache = jQuery.cache,
special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;
Method searched_datasets
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def searched_datasets
datasets = DatasetDescription.where(:is_active => true)
Rails.logger.info "search: find datasets"
Function addClass
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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")) );
Method parse_address
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parse_address(full_address)
zip = place = ''
items = full_address.split(',')
if items.size < 3
address = items[0]
Method digest_founders
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(' ')
Function toggleClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
Function type
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn[ type ] = function( size ) {
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
Function >
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
Method create_resources
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_resources(resource_type, resources, attributes)
all_ids = resources.map(&:_record_id)
active_objects = []
attributes.each do |obj_hash|
case resource_type
Consider simplifying this complex logical expression. Open
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] ];
Method add_to_sphinx_search
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_to_sphinx_search(operand, sphinx_search)
options = {with: {}, without: {}}
operand ||= "*"
case operator
- Read upRead up
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
Open
def customer_information(document)
customer_information_hash = {}
case document_type(document)
when :standard
- Read upRead up
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
Open
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
Avoid deeply nested control flow statements. Open
Open
if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
ret.push({ selector: selector, elem: cur, level: level });
}
Avoid deeply nested control flow statements. Open
Open
if ( display === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.display = "inline";
Avoid deeply nested control flow statements. Open
Open
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
Avoid deeply nested control flow statements. Open
Open
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
Avoid deeply nested control flow statements. Open
Open
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
Avoid deeply nested control flow statements. Open
Open
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}