app/services/abf_worker_service/rpm.rb
Showing 4 of 4 total issues
Method build_rpms
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.build_rpms(testing = false) available_repos = BuildList. select('MIN(updated_at) as min_updated_at, save_to_repository_id, build_for_platform_id'). where(new_core: true, status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)). group(:save_to_repository_id, :build_for_platform_id).
- Read upRead up
Method create
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
def create key = "#{save_to_repository_id}-#{build_for_platform_id}" projects_for_cleanup = $redis.with { |r| r.lrange(PROJECTS_FOR_CLEANUP, 0, -1) }.select do |k| (testing && k =~ /^testing-[\d]+-#{key}$/) || (!testing && k =~ /^[\d]+-#{key}$/) end
- Read upRead up
Method create
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create key = "#{save_to_repository_id}-#{build_for_platform_id}" projects_for_cleanup = $redis.with { |r| r.lrange(PROJECTS_FOR_CLEANUP, 0, -1) }.select do |k| (testing && k =~ /^testing-[\d]+-#{key}$/) || (!testing && k =~ /^[\d]+-#{key}$/) end
Method build_rpms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_rpms(testing = false) available_repos = BuildList. select('MIN(updated_at) as min_updated_at, save_to_repository_id, build_for_platform_id'). where(new_core: true, status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)). group(:save_to_repository_id, :build_for_platform_id).