Showing 18,390 of 18,390 total issues
Method create_action_url
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_action_url(node)
if @sb[:action] == "miq_ae_domain_priority_edit"
'domains_priority_edit'
elsif @sb[:action] == 'miq_ae_field_seq'
'fields_seq_edit'
- Create a ticketCreate a ticket
Method copy_save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def copy_save
assert_privileges(feature_by_action)
return unless load_edit("copy_objects__#{params[:id]}", "replace_cell__explorer")
begin
- Create a ticketCreate a ticket
Method fields_set_form_vars
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fields_set_form_vars
@in_a_form_fields = true
session[:field_data] = {}
@edit = {
:ae_class_id => @ae_class.id,
- Create a ticketCreate a ticket
Method replace_right_cell
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def replace_right_cell(_nodetype)
# Get the tags for this node for the Classification pulldown
@sb[:tags] = nil unless params[:miq_date_1] || params[:miq_date_2] # Clear tags unless just changing date
unless @nodetype == "h" || @nodetype == "s" || params[:miq_date_1] || params[:miq_date_2] # Get the tags for the pulldown, unless host, storage, or just changing the date
if @sb[:options][:chart_date]
- Create a ticketCreate a ticket
Method button
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def button
@edit = session[:edit] # Restore @edit for adv search box
params[:display] = @display if ["#{params[:controller]}s"].include?(@display) # displaying container_*
params[:page] = @current_page if @current_page.nil? # Save current page for list refresh
- Create a ticketCreate a ticket
Method update
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
assert_privileges("cloud_volume_edit")
@volume = find_record_with_rbac(CloudVolume, params[:id])
case params[:button]
- Create a ticketCreate a ticket
Method replace_list_grid
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def replace_list_grid
view = @view
button_div = 'center_tb'
action_url = if @lastaction == "scan_history"
"scan_history"
- Create a ticketCreate a ticket
Method gfv_model
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gfv_model
if params[:chosen_model] && # Check for db table changed
params[:chosen_model] != @edit[:new][:model]
@edit[:new][:model] = params[:chosen_model]
@edit[:new][:perf_interval] = nil # Clear performance interval setting
- Create a ticketCreate a ticket
Method get_node_info
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_node_info(treenodeid, _show_list = true)
@explorer ||= true
@nodetype, id = parse_nodetype_and_id(valid_active_node(treenodeid))
# saving this so it can be used while adding buttons/groups in buttons editor
@sb[:applies_to_id] = id
- Create a ticketCreate a ticket
Method db_available_widgets_options
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def db_available_widgets_options
# Build the available widgets for the pulldown
col_widgets = @edit[:new][:col1] +
@edit[:new][:col2]
if @sb[:nodes].length == 2 && @sb[:nodes][1] != "g"
- Create a ticketCreate a ticket
Method get_all_reps
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_all_reps(nodeid = nil)
# set nodeid from @sb, incase sort was pressed
nodeid = x_active_tree == :reports_tree ? x_node.split('-').last : x_node.split('-').last.split('_')[0] if nodeid.nil?
@sb[:miq_report_id] = nodeid
@record = @miq_report = MiqReport.for_user(current_user).find(@sb[:miq_report_id])
- Create a ticketCreate a ticket
Method delete_cloud_tenants
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_cloud_tenants
assert_privileges("cloud_tenant_delete")
tenants = find_records_with_rbac(CloudTenant, checked_or_params)
tenants_to_delete = []
tenants.each do |tenant|
- Create a ticketCreate a ticket
Method heatmaps_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def heatmaps_data(metrics)
node_cpu_usage = []
node_memory_usage = []
metrics.each do |m|
- Create a ticketCreate a ticket
Method notification_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def notification_data(components, component_type)
if components&.first.respond_to?(:health_state)
count = 0
health_states = components.each_with_object({}) do |component, health_state|
health_state[component.health_state&.downcase] = (health_state[component.health_state&.downcase] || 0) + 1
- Create a ticketCreate a ticket
Similar blocks of code found in 7 locations. Consider refactoring. Open
def process_floating_ips(floating_ips, operation)
return if floating_ips.empty?
if operation == "destroy"
floating_ips.each do |floating_ip|
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
def process_cloud_networks(networks, operation)
return if networks.empty?
if operation == "destroy"
networks.each do |network|
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
def process_cloud_tenants(tenants, task)
return if tenants.empty?
if task == "destroy"
tenants.each do |tenant|
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
def process_cloud_volume_snapshots(snapshots, task)
return if snapshots.empty?
if task == "destroy"
snapshots.each do |snapshot|
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
def process_network_routers(routers, operation)
return if routers.empty?
if operation == "destroy"
routers.each do |router|
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
def process_cloud_object_store_container(containers, operation)
return if containers.empty?
if operation == "destroy"
containers.each do |container|
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76