Showing 700 of 1,230 total issues
Function draggable
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function draggable(element, onmove, onstart, onstop) {
onmove = onmove || function () { };
onstart = onstart || function () { };
onstop = onstop || function () { };
var doc = document;
File report.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
class StripeService::Report
private
attr_reader :tx, :exception
Method msg_type
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def msg_type(txn_type, payment_status, pending_reason, invoice_num)
txn_type = txn_type.to_s.downcase
status, reason = payment_status.to_s.downcase, pending_reason.to_s.downcase
inv_type = Invnum.type(invoice_num) if invoice_num
- 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 availability_per_hour_calculate_blocked_dates
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def availability_per_hour_calculate_blocked_dates
return @availability_per_hour_raw_blocked_dates if defined?(@availability_per_hour_raw_blocked_dates)
all_options = availability_per_hour_calculate_options_for_select
result = []
- 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 availability_per_hour_calculate_options_for_select
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def availability_per_hour_calculate_options_for_select
return @availability_per_hour_raw_options_for_select if defined?(@availability_per_hour_raw_options_for_select)
result = {}
current_day = 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
Function FastClick
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FastClick(layer, options) {
var oldOnClick;
options = options || {};
Function imageUploadElementManager
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.ST.imageUploadElementManager = function($container) {
var empties = [];
var uploadings = [];
var previews = [];
Class PreauthorizeTransactionsController
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class PreauthorizeTransactionsController < ApplicationController
before_action do |controller|
controller.ensure_logged_in t("layouts.notifications.you_must_log_in_to_do_a_transaction")
end
Class TestimonialsService
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin::TestimonialsService
attr_reader :community, :params
def initialize(community:, params:)
@params = params
Class TestimonialsService
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin2::TestimonialsService
attr_reader :community, :params
def initialize(community:, params:)
@params = params
Function createOptionOrder
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createOptionOrder = function(rowSelector) {
/**
Fetch all custom field rows and save them to a variable
*/
Method topbar_props
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def topbar_props(community:, path_after_locale_change:, user: nil, search_placeholder: nil,
locale_param: nil, current_path: nil, landing_page: false, host_with_port:)
links = links(community: community, user: user, locale_param: locale_param, host_with_port: host_with_port)
Function initialize_update_account_info_form
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialize_update_account_info_form(locale, change_text, cancel_text, email_in_use_message, one_email_must_receive_notifications_message) {
$('.account-new-email-link').click(
function(event) {
event.preventDefault();
$('.account-new-email-link').hide();
Function createOptionOrder
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createOptionOrder = function(rowSelector) {
/**
Fetch all custom field rows and save them to a variable
*/
Function orderManager
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.ST.orderManager = function(fieldMap) {
var utils = ST.utils;
var byFieldId = _.curry(function(id, field) {
return field.id === id;
Function initFooter
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initFooter() {
$(document).off('click', '#new-footerLink-trigger');
$(document).on('click', '#new-footerLink-trigger', function(event) {
var time = new Date().getTime(),
Method marketplace_data
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def marketplace_data(cid, locale)
community = Community.find(cid)
primary_color = community.custom_color1
twitter_handle = community.twitter_handle
name_display_type = community.name_display_type
Method do_create_preauth_payment
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_create_preauth_payment(tx, gateway_fields, seller_account)
seller_id = seller_account[:stripe_seller_id]
payment_method_id = gateway_fields[:stripe_payment_method_id]
subtotal = order_total(tx)
Function utils
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
ST.utils = (function(_) {
function findNextIndex(arr, fn) {
if(arr.length < 2) {
return -1;
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def update
if (params[:listing][:origin] && (params[:listing][:origin_loc_attributes][:address].empty? || params[:listing][:origin].blank?))
params[:listing].delete("origin_loc_attributes")
if @listing.origin_loc
@listing.origin_loc.delete
- 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"