rosa-abf/rosa-build

View on GitHub
app/controllers/api/v1/jobs_controller.rb

Summary

Maintainability
C
7 hrs
Test Coverage

Showing 2 of 2 total issues

Method shift has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

def shift
$redis.with do |r|
job_shift_sem = Redis::Semaphore.new(:job_shift_lock, redis: r)
job_shift_sem.lock do
shifted_build_lists = r.smembers('abf_worker:shifted_build_lists')
Severity: Minor
Found in app/controllers/api/v1/jobs_controller.rb - About 5 hrs to fix

Method shift has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def shift
$redis.with do |r|
job_shift_sem = Redis::Semaphore.new(:job_shift_lock, redis: r)
job_shift_sem.lock do
shifted_build_lists = r.smembers('abf_worker:shifted_build_lists')
Severity: Major
Found in app/controllers/api/v1/jobs_controller.rb - About 2 hrs to fix
    Category
    Status