Showing 16 of 92 total issues
Method build_candidate_tags
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private def build_candidate_tags
full_tag_set = {}
candidate_tags = []
add_default_tag = proc do |tag|
Method reclaim_for_queue
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private def reclaim_for_queue(redis: nil, site: '', queue_name: '',
cutoff_seconds: 120)
reclaimed_for_queue = []
claimed_by_id = redis.hgetall("queue:#{site}:#{queue_name}:claims")
claimed_by_processor = {}
Method reconcile!
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reconcile!(with_ids: JobBoard.config.reconcile_stats_with_ids,
purge_unknown: false,
cutoff_seconds: JobBoard.config.reconcile_cutoff_seconds)
JobBoard.logger.info('starting reconciliation process')
start_time = Time.now
Method reconcile!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def reconcile!(with_ids: JobBoard.config.reconcile_stats_with_ids,
purge_unknown: false,
cutoff_seconds: JobBoard.config.reconcile_cutoff_seconds)
JobBoard.logger.info('starting reconciliation process')
start_time = Time.now
- 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 build_candidate_tags
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private def build_candidate_tags
full_tag_set = {}
candidate_tags = []
add_default_tag = proc do |tag|
- 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 run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
results = { :@site => site }
if queue_name.empty?
results[:jobs] = JobBoard::JobQueue.for_site(
Method call
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
auth = Request.new(env)
if site_paths =~ auth.request.path_info &&
!env.key?('HTTP_TRAVIS_SITE')
Method run
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
return nil if job_id.empty? || site.empty?
job = {}
db_job = fetch_db_job
Method claim
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def claim(processor: '')
raise Invalid, 'missing processor name' if processor.empty?
claimed = 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
Method call
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
auth = Request.new(env)
if site_paths =~ auth.request.path_info &&
!env.key?('HTTP_TRAVIS_SITE')
- 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 for_queue
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.for_queue(redis: nil, site: '', queue_name: '')
redis ||= JobBoard.redis
raise Invalid, 'unknown queue' unless redis.sismember("queues:#{site}", queue_name)
claims = nil
Method update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update(request_body)
JobBoard.logger.debug(
'handling request', request_body: request_body.inspect
)
- 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 reclaim_for_queue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private def reclaim_for_queue(redis: nil, site: '', queue_name: '',
cutoff_seconds: 120)
reclaimed_for_queue = []
claimed_by_id = redis.hgetall("queue:#{site}:#{queue_name}:claims")
claimed_by_processor = {}
- 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
Avoid too many return
statements within this method. Open
return unauthorized
Avoid too many return
statements within this method. Open
return @app.call(env)
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
if caching_enabled
cached_script = fetch_cached
return cached_script unless cached_script.nil?
end
- 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"