mhenrixon/sidekiq-unique-jobs

View on GitHub

Showing 32,163 of 32,163 total issues

Complex method DeviseCreateUsers#change (27.8)
Open

def change
create_table :users do |t|
t.boolean :admin, default: false
## Database authenticatable
t.string :email, null: false, default: ""

Complex method SidekiqUniqueJobs::SidekiqWorkerMethods#after_unlock_hook (27.6)
Open

def after_unlock_hook # rubocop:disable Metrics/MethodLength
lambda do
if @original_job_class.respond_to?(:after_unlock)
# instance method in sidekiq v6
if @original_job_class.method(:after_unlock).arity.positive? # arity check to maintain backwards compatibility

Complex method SidekiqUniqueJobs::Locksmith#enqueue (26.6)
Open

def enqueue(conn)
queued_jid, elapsed = timed do
call_script(:queue, key.to_a, argv, conn)
end
 
 
Severity: Minor
Found in lib/sidekiq_unique_jobs/locksmith.rb by flog

Complex method DeviseHelper#devise_simple_error_messages! (26.5)
Open

def devise_simple_error_messages!
return if resource.errors.empty?
 
sentence = "Ooops!"
if resource.errors.count == 1
Severity: Minor
Found in myapp/app/helpers/devise_helper.rb by flog

Complex method DeviseHelper#devise_error_messages! (26.4)
Open

def devise_error_messages!
return if resource.errors.empty?
 
messages = resource.errors.full_messages.map { |msg| content_tag(:p, "- #{msg}.") }
.join
Severity: Minor
Found in myapp/app/helpers/devise_helper.rb by flog

Complex method SidekiqUniqueJobs::LockConfig#initialize (26.0)
Open

def initialize(job_hash = {})
@type = job_hash[LOCK]&.to_sym
@job = SidekiqUniqueJobs.safe_constantize(job_hash[CLASS])
@limit = job_hash.fetch(LOCK_LIMIT, 1)&.to_i
@timeout = job_hash.fetch(LOCK_TIMEOUT, 0)&.to_i
Severity: Minor
Found in lib/sidekiq_unique_jobs/lock_config.rb by flog

Similar blocks of code found in 2 locations. Consider refactoring.
Open

$('.toggleSource').toggle(function() {
$(this).parent().nextAll('.source_code').slideDown(100);
$(this).text("Hide source");
},
Severity: Minor
Found in doc/js/app.js and 1 other location - About 50 mins to fix
doc/js/app.js on lines 14..17

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function() {
$(this).parent().nextAll('.source_code').slideUp(100);
$(this).text("View source");
});
Severity: Minor
Found in doc/js/app.js and 1 other location - About 50 mins to fix
doc/js/app.js on lines 10..13

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (localStorage.summaryCollapsed == "collapse") {
$('.summary_toggle').first().click();
} else { localStorage.summaryCollapsed = "expand"; }
Severity: Minor
Found in doc/js/app.js and 1 other location - About 50 mins to fix
doc/js/app.js on lines 161..163

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (localStorage.summaryCollapsed == "collapse") {
$('.constants_summary_toggle').first().click();
} else { localStorage.summaryCollapsed = "expand"; }
Severity: Minor
Found in doc/js/app.js and 1 other location - About 50 mins to fix
doc/js/app.js on lines 118..120

Similar blocks of code found in 2 locations. Consider refactoring.
Open

}, function() {
$('#toc .top').slideDown('fast');
$('#toc').toggleClass('hidden');
$('#toc .title small').toggle();
});
Severity: Minor
Found in doc/js/app.js and 1 other location - About 45 mins to fix
doc/js/app.js on lines 219..223

Method registered has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def self.registered(app) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
app.helpers Web::Helpers
 
app.get "/changelogs" do
@filter = h(safe_url_params("filter") || "*")
Severity: Minor
Found in lib/sidekiq_unique_jobs/web.rb - About 45 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

$('#toc .hide_toc').toggle(function() {
$('#toc .top').slideUp('fast');
$('#toc').toggleClass('hidden');
$('#toc .title small').toggle();
}, function() {
Severity: Minor
Found in doc/js/app.js and 1 other location - About 45 mins to fix
doc/js/app.js on lines 223..227

Complex method SidekiqUniqueJobs::Lock#del (24.0)
Open

def del
redis do |conn|
conn.multi do |pipeline|
pipeline.zrem(DIGESTS, key.digest)
pipeline.del(key.digest, key.queued, key.primed, key.locked, key.info)
Severity: Minor
Found in lib/sidekiq_unique_jobs/lock.rb by flog

Identical blocks of code found in 2 locations. Consider refactoring.
Open

$(this).parent().prev().height($(this).parent().height());
Severity: Minor
Found in doc/js/app.js and 1 other location - About 35 mins to fix
doc/js/app.js on lines 42..42

Identical blocks of code found in 2 locations. Consider refactoring.
Open

$(this).parent().prev().height($(this).parent().height());
Severity: Minor
Found in doc/js/app.js and 1 other location - About 35 mins to fix
doc/js/app.js on lines 26..26

Complex method SidekiqUniqueJobs::Locksmith#lock_info (23.0)
Open

def lock_info
@lock_info ||= dump_json(
WORKER => item[CLASS],
QUEUE => item[QUEUE],
LIMIT => item[LOCK_LIMIT],
Severity: Minor
Found in lib/sidekiq_unique_jobs/locksmith.rb by flog

Method enqueue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def enqueue(conn)
queued_jid, elapsed = timed do
call_script(:queue, key.to_a, argv, conn)
end
 
 
Severity: Minor
Found in lib/sidekiq_unique_jobs/locksmith.rb - About 35 mins to fix

Method constantize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def constantize(str)
return str.class if str.is_a?(Sidekiq::Job) # sidekiq v6.x
return str unless str.is_a?(String)
return Object.const_get(str) unless str.include?("::")
 
 
Severity: Minor
Found in lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb - About 35 mins to fix

Complex method SidekiqUniqueJobs::UpgradeLocks#call (22.6)
Open

def call
with_logging_context do
return log_info("Already upgraded to #{version}") if conn.hget(upgraded_key, version)
# TODO: Needs handling of v7.0.0 => v7.0.1 where we don't want to
return log_info("Skipping upgrade because #{DEAD_VERSION} has been set") if conn.get(DEAD_VERSION)
Severity
Category
Status
Source
Language