Showing 6 of 8 total issues
Method process
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.process
# Process user input ..
opts = VolumeSweeper::Cli.run
cloud = opts.cloud
mode = opts.mode&.to_sym
Method scan_block_volumes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scan_block_volumes
volumes = Array.new
opts = { compartment_id: @compartment_id, limit: DEFAULT_PAGE_SIZE, lifecycle_state: 'AVAILABLE' }
run_api_call do |config|
Method formlate_meessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def formlate_meessage volumes, active_count: nil
active_list = volumes[:active_ids]
unused_list = volumes[:unused_ids]
active_count = active_count || volumes[:active_ids] || 0
Method process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.process block_volumes, persistent_volumes
unused_volumes = []
active_volumes = []
counters = { active: 0, unused: 0 }
- 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 delete_block_volumes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_block_volumes ids_list
@log.msg "oci: #{ids_list&.count || 0} block volumes are eligible for cleanup."
return if ids_list.blank?
unless @run_mode == :delete
- 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 formlate_meessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def formlate_meessage volumes, active_count: nil
active_list = volumes[:active_ids]
unused_list = volumes[:unused_ids]
active_count = active_count || volumes[:active_ids] || 0
- 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"