Showing 2,015 of 18,390 total issues
Method add_host
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def add_host
assert_privileges("host_aggregate_add_host")
@host_aggregate = find_record_with_rbac(HostAggregate, params[:id])
case params[:button]
- Create a ticketCreate a ticket
Method comp_add_header_compressed
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def comp_add_header_compressed(view, h, i)
txt = h[:name].truncate(16)
html_text = ""
if %w[Vm VmOrTemplate].include?(@sb[:compare_db])
img = ActionController::Base.helpers.image_path(h.decorate.fileicon)
- Create a ticketCreate a ticket
Method adv_search_button
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def adv_search_button
@edit = session[:edit]
@view = session[:view]
# setting default to false
- Create a ticketCreate a ticket
Method handle_bottom_cell
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def handle_bottom_cell(presenter)
if allowed(@sb[:action]) && (@pages || @in_a_form)
if @pages
presenter.hide(:form_buttons_div)
elsif @in_a_form && @sb[:action]
- Create a ticketCreate a ticket
Method tree_select
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def tree_select
assert_accordion_and_tree_privileges(x_active_tree)
params[:miq_grid_checks] = []
@explorer = true
@lastaction = "explorer"
- Create a ticketCreate a ticket
Method button
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def button
case params[:pressed]
when 'embedded_configuration_script_source_refresh' # refresh repositories
repository_refresh
when "embedded_configuration_script_source_edit" # edit repository
- Create a ticketCreate a ticket
Method folder_get_info
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def folder_get_info(folder_node)
nodetype, nodeid = folder_node.split("_")
@sb[:mode] = nil
@sb[:nodeid] = nil
@sb[:folder] = nodeid.nil? ? nodetype.split("-").last : nodeid
- Create a ticketCreate a ticket
Method retirevms
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def retirevms
assert_privileges(params[:pressed])
# check to see if coming from show_list or drilled into vms from another CI
if request.parameters[:controller] == "vm" || %w[all_vms instances vms].include?(params[:display])
rec_cls = "vm"
- Create a ticketCreate a ticket
Method stacks_ot_copy_submit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def stacks_ot_copy_submit
assert_privileges('orchestration_template_copy')
original_template = find_record_with_rbac(OrchestrationTemplate, params[:templateId])
if params[:templateContent] == original_template.content
add_flash(_("Unable to create a new template copy \"%{name}\": old and new template content have to differ.") %
- Create a ticketCreate a ticket
Method vm_reconfigure
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def vm_reconfigure
assert_privileges('vm_reconfigure_all', :any => true)
# if coming in to edit from miq_request list view
recs = checked_or_params
- Create a ticketCreate a ticket
Method alert_profile_build_assign_screen
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def alert_profile_build_assign_screen
@assign = {}
@assign[:new] = {}
@assign[:current] = {}
@sb[:action] = "miq_alert_set_assign"
- Create a ticketCreate a ticket
Method process_saved_reports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_saved_reports(saved_reports, task)
success_count = 0
failure_count = 0
params[:miq_grid_checks] = params[:miq_grid_checks]&.split(",")
MiqReportResult.for_user(current_user).where(:id => saved_reports).order(MiqReportResult.arel_table[:name].lower).each do |rep|
- Create a ticketCreate a ticket
Method open_parent_nodes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def open_parent_nodes(record)
existing_node = nil # Init var
if record.kind_of?(OrchestrationTemplate)
parents = [:id => template_to_node_name(record)]
- Create a ticketCreate a ticket
Method show_preview
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def show_preview
assert_privileges(session.fetch_path(:edit, :rpt_id) ? "miq_report_edit" : "miq_report_new")
unless params[:task_id] # First time thru, kick off the report generate task
@rpt = create_report_object # Build a report object from the latest edit fields
- Create a ticketCreate a ticket
Method remove_interface
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def remove_interface
assert_privileges("network_router_remove_interface")
@router = find_record_with_rbac(NetworkRouter, params[:id])
case params[:button]
- Create a ticketCreate a ticket
Method add_interface
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def add_interface
assert_privileges("network_router_add_interface")
@router = find_record_with_rbac(NetworkRouter, params[:id])
case params[:button]
- Create a ticketCreate a ticket
Method widget_validate_entries
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def widget_validate_entries
if %w[r c].include?(@sb[:wtype]) && (!@edit[:new][:repfilter] || @edit[:new][:repfilter] == "")
add_flash(_("A Report must be selected"), :error)
end
if %w[role group].include?(@edit[:new][:visibility_typ])
- Create a ticketCreate a ticket
Method heatmaps
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def heatmaps
# Get latest hourly rollup for each node.
cluster_ids = @ems.ems_clusters if @ems.present?
metrics = MetricRollup.latest_rollups(EmsCluster.name, cluster_ids)
metrics = metrics.where('timestamp > ?', 30.days.ago.utc).includes(:resource)
- Create a ticketCreate a ticket
Function renderGitImport
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderGitImport: function(branches, tags, gitRepoId, messages) {
clearMessages();
var message = messages.message;
var messageLevel = messages.level;
- Create a ticketCreate a ticket
Function link
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, elem, attr, ctrl) {
scope['form_' + ctrl.$name] = elem[0];
scope['form_' + ctrl.$name + '_timerHide'] = attr.timerHide;
scope.$watch(attr.ngModel, function() {
- Create a ticketCreate a ticket