mhenrixon/sidekiq-unique-jobs

View on GitHub

Showing 32,163 of 32,163 total issues

Complex method SidekiqUniqueJobs::Script::LuaError#generate_error_context (22.4)
Open

def generate_error_context(content, line_number)
lines = content.lines.to_a
beginning_line_number = [1, line_number - CONTEXT_LINE_NUMBER].max
ending_line_number = [lines.count, line_number + CONTEXT_LINE_NUMBER].min
line_number_width = ending_line_number.to_s.length

Complex method SidekiqUniqueJobs::Orphans::RubyReaper#entries (22.2)
Open

def entries(conn, queue, &block) # rubocop:disable Metrics/MethodLength
queue_key = "queue:#{queue}"
initial_size = conn.llen(queue_key)
deleted_size = 0
page = 0

Complex method SidekiqUniqueJobs::Locksmith#lock! (21.9)
Open

def lock!(conn, primed_method, wait = nil)
return yield if locked?(conn)
 
enqueue(conn) do |queued_jid|
reflect(:debug, :queued, item, queued_jid)
Severity: Minor
Found in lib/sidekiq_unique_jobs/locksmith.rb by flog

Complex method SidekiqUniqueJobs::OnConflict::Reschedule#call (21.8)
Open

def call
if sidekiq_job_class?
if job_class.set(queue: item["queue"].to_sym).perform_in(schedule_in, *item[ARGS])
reflect(:rescheduled, item)
else

Method execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def execute
synchronize do
if @running.false?
@running.make_true
schedule_next_task(@run_now ? 0 : @execution_interval)
Severity: Minor
Found in lib/sidekiq_unique_jobs/timer_task.rb - About 25 mins to fix

Method logging_context has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def logging_context
middleware = is_a?(SidekiqUniqueJobs::Middleware::Client) ? :client : :server
digest = item[LOCK_DIGEST]
lock_type = item[LOCK]
 
 
Severity: Minor
Found in lib/sidekiq_unique_jobs/logging/middleware_context.rb - About 25 mins to fix

Method scripts_path= has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def scripts_path=(obj)
raise ArgumentError, "#{obj} should be a Pathname or String" unless obj.is_a?(Pathname) || obj.is_a?(String)
raise ArgumentError, "#{obj} does not exist" unless Dir.exist?(obj.to_s)
 
@scripts_path =
Severity: Minor
Found in lib/sidekiq_unique_jobs/script/config.rb - About 25 mins to fix

Method delete_by_digest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def delete_by_digest(digest, queuetime: true, runtime: true)
result, elapsed = timed do
call_script(
:delete_by_digest,
queuetime_keys(queuetime ? digest : nil) + runtime_keys(runtime ? digest : nil) + [key],
Severity: Minor
Found in lib/sidekiq_unique_jobs/digests.rb - About 25 mins to fix

Method lock_args_method has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def lock_args_method
@lock_args_method ||= job_options.slice(LOCK_ARGS_METHOD, UNIQUE_ARGS_METHOD).values.first
@lock_args_method ||= :lock_args if job_method_defined?(:lock_args)
@lock_args_method ||= :unique_args if job_method_defined?(:unique_args)
@lock_args_method ||= default_lock_args_method
Severity: Minor
Found in lib/sidekiq_unique_jobs/lock_args.rb - About 25 mins to fix

Complex method SidekiqUniqueJobs::Changelog#page (20.6)
Open

def page(cursor: 0, pattern: "*", page_size: 100)
redis do |conn|
total_size, result = conn.multi do |pipeline|
pipeline.zcard(key)
pipeline.zscan(key, cursor, match: pattern, count: page_size)
Severity: Minor
Found in lib/sidekiq_unique_jobs/changelog.rb by flog

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

def add_strategy(name, klass)
strategy_sym = name.to_sym
raise DuplicateStrategy, ":#{name} already defined, please use another name" if strategies.key?(strategy_sym)
 
new_strategies = strategies.dup.merge(strategy_sym => klass).freeze
Severity: Minor
Found in lib/sidekiq_unique_jobs/config.rb and 1 other location - About 15 mins to fix
lib/sidekiq_unique_jobs/config.rb on lines 285..290

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

def add_lock(name, klass)
lock_sym = name.to_sym
raise DuplicateLock, ":#{name} already defined, please use another name" if locks.key?(lock_sym)
 
new_locks = locks.dup.merge(lock_sym => klass).freeze
Severity: Minor
Found in lib/sidekiq_unique_jobs/config.rb and 1 other location - About 15 mins to fix
lib/sidekiq_unique_jobs/config.rb on lines 304..309

Line length
Open

- fix\(ci\): allow tests to run in docker [\#805](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/805) ([Earlopain](https://github.com/Earlopain))
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- fix: Sidekiq 7.2 throws TypeError: Unsupported command argument type: TrueClass when using byscore: true [\#815](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/815) ([Amnesthesia](https://github.com/Amnesthesia))
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- Logging::Middleware.context can include empty string as key when lock is not set in job hash [\#785](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/785)
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- Fix minor typo in drift\_reaper\_interval comment [\#755](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/755) ([lazyatom](https://github.com/lazyatom))
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- fix\(digests\): ensure consistent digests [\#743](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/743) ([mhenrixon](https://github.com/mhenrixon))
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- Add Dependabot for GitHub Actions [\#717](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/717) ([petergoldstein](https://github.com/petergoldstein))
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- Prepare for redis 5.0.0 [\#680](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/680) ([mhenrixon](https://github.com/mhenrixon))
Severity: Info
Found in CHANGELOG.md by markdownlint

Line length
Open

- Fix homepage url [\#667](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/667) ([dal-ioki](https://github.com/dal-ioki))
Severity: Info
Found in CHANGELOG.md by markdownlint
Severity
Category
Status
Source
Language