Showing 46 of 46 total issues
Method transform_oneshot_lines_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def transform_oneshot_lines_results(results)
results.each_with_object({}) do |(file, coverage), new_results|
###
# Eager filter:
# Normally I would break this out into additional methods
- 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 fix_file_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fix_file_names(report_hash, roots)
Coverband.configuration.logger.debug "fixing root: #{roots.join(", ")}" if Coverband.configuration.verbose
# normalize names across servers
report_hash.each_with_object({}) do |(name, report), fixed_report|
- 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 add_coverage_for_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_coverage_for_file(data_from_redis, hash)
return if data_from_redis.empty?
file = data_from_redis[FILE_KEY]
return unless file_hash(file) == data_from_redis[FILE_HASH]
- 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 save_report
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_report
reported_time = Time.now.to_i
if @views_to_record.any?
relative_views = @views_to_record.map! do |view|
roots.each do |root|
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(redis, opts = {})
super()
@redis_namespace = opts[:redis_namespace]
@save_report_batch_size = opts[:save_report_batch_size] || 100
@format_version = REDIS_STORAGE_FORMAT_VERSION
- 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 save_coverage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_coverage(data)
if Coverband.configuration.api_key.nil?
puts "Coverband: Error: no Coverband API key was found!"
return
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"