Showing 203 of 346 total issues
Avoid deeply nested control flow statements. Open
if ($customRadio.length === 0) {
$customRadio = $associatedElement.add(this).siblings('span.custom.radio').first();
}
Avoid deeply nested control flow statements. Open
if (this.settings.timer > 0) {
this.settings.$next_tip
.fadeIn(this.settings.tipAnimationFadeSpeed)
.show();
Avoid deeply nested control flow statements. Open
if (!region.hasClass(self.settings.active_class))
region.addClass(self.settings.active_class);
Avoid deeply nested control flow statements. Open
if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
this.result_clear_highlight();
}
Avoid deeply nested control flow statements. Open
if (placeholder !== elem.getAttribute(ATTR_CURRENT_VAL) || (elem.type === "password" && !elem.getAttribute(ATTR_INPUT_TYPE))) {
// Attempt to change the type of password inputs (fails in IE < 9)
if (elem.type === "password" && !elem.getAttribute(ATTR_INPUT_TYPE) && Utils.changeType(elem, "text")) {
elem.setAttribute(ATTR_INPUT_TYPE, "password");
Avoid deeply nested control flow statements. Open
if ( typeof elem.getElementsByTagName !== "undefined" ) {
// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
// Splice the scripts into ret after their former ancestor and advance our index beyond them
Avoid deeply nested control flow statements. Open
if (parts.length) {
for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
part = parts[_j];
if (regex.test(part)) {
found = true;
Avoid deeply nested control flow statements. Open
if (!elem.getAttribute(ATTR_EVENTS_BOUND)) {
newElement(elem);
}
Function add
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function add(element, events, fn, selector, getDelegate, capture){
Avoid deeply nested control flow statements. Open
if ($(klass).hasClass('fixed')) {
$(klass).removeClass('fixed');
$('body').removeClass('f-topbar-fixed');
}
Avoid deeply nested control flow statements. Open
if (searchText.length) {
startpos = option.html.search(zregex);
text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
} else {
Avoid deeply nested control flow statements. Open
if (option.group_array_index != null) {
$("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
}
Function init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
init : function (scope, libraries, method, options, response, /* internal */ nc) {
Method update_tax_rates
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_tax_rates
if saved_change_to_attribute?(:ship_address_id)
# set_beginning_values
tax_time = completed_at? ? completed_at : Time.zone.now
order_items.each do |item|
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
if params[:address].present?
@shopping_address = current_user.addresses.new(allowed_params)
@shopping_address.default = true if current_user.default_shipping_address.nil?
@shopping_address.billing_default = true if current_user.default_billing_address.nil?
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
if params[:address].present?
@billing_address = checkout_user.addresses.new(allowed_params)
@billing_address.default = true if checkout_user.default_billing_address.nil?
@billing_address.billing_default = true if checkout_user.default_billing_address.nil?
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
if params[:address].present?
@shipping_address = checkout_user.addresses.new(allowed_params)
@shipping_address.default = true if checkout_user.default_shipping_address.nil?
@shipping_address.billing_default = true if checkout_user.default_billing_address.nil?
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
if params[:address].present?
@shopping_address = current_user.addresses.new(allowed_params)
@shopping_address.default = true if current_user.default_shipping_address.nil?
@shopping_address.billing_default = true if current_user.default_billing_address.nil?
- 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 update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update
all_selected = true
redirect_to(shopping_orders_url) and return unless params[:shipping_category].present?
params[:shipping_category].each_pair do |category_id, rate_id|#[rate]
if rate_id.present?
- 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 update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update
all_selected = true
if params[:shipping_category].present?
params[:shipping_category].each_pair do |category_id, rate_id|#[rate]
if rate_id.present?
- 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"