Method patch
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def patch(params)
# skip the phase if not needed
return if params.nil? or params[:core].nil?
trace :debug, "Build: patching [#{params[:core]}] file"
Class Build
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Build
include RCS::Tracer
attr_reader :outputs
attr_reader :scrambled
Method patch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def patch(params)
# skip the phase if not needed
return if params.nil? or params[:core].nil?
trace :debug, "Build: patching [#{params[:core]}] file"
- 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 unpack
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def unpack
trace :debug, "Build: unpack: #{@core_filepath}"
Zip::File.open(@core_filepath) do |z|
z.each do |f|
- 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 load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load(params)
raise "Some cores were not loaded in the DB. Please check them." unless RCS::DB::Core.all_loaded?
core = ::Core.where({name: @platform}).first
raise "Core for #{@platform} not found" if core.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"