Showing 2,015 of 18,390 total issues
Method gfv_chargeback
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def gfv_chargeback
# Chargeback options
if params.key?(:cb_show_typ)
@edit[:new][:cb_show_typ] = params[:cb_show_typ].presence
@refresh_div = "filter_div"
- Read upRead up
- Create a ticketCreate a ticket
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 alert_build_exp_options_info
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def alert_build_exp_options_info
MiqAlert.expression_options(@edit[:new][:expression][:eval_method]).each do |eo|
case eo[:name]
when :ems_id
- Read upRead up
- Create a ticketCreate a ticket
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 alert_set_record_vars
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def alert_set_record_vars(alert)
alert.description = @edit[:new][:description]
alert.enabled = @edit[:new][:enabled]
alert.severity = @edit[:new][:severity]
alert.db = @edit[:new][:db]
- Read upRead up
- Create a ticketCreate a ticket
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 heatmaps
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. 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)
- Read upRead up
- Create a ticketCreate a ticket
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 show_adv_search?
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show_adv_search?
show_search = %w[
auth_key_pair_cloud
availability_zone
automation_manager_configured_system
- Create a ticketCreate a ticket
File helper.jsx
has 428 lines of code (exceeds 400 allowed). Consider refactoring. Open
import React from 'react';
import ChartCard from './chart-card';
import { chartConfig } from '../provider-dashboard-charts/charts_config';
import PfAggregateStatusCard from '../pf_aggregate_status_card';
- Create a ticketCreate a ticket
Class ToolbarChooser
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationHelper::ToolbarChooser
include RestfulControllerMixin
# Return a blank tb if a placeholder is needed for AJAX explorer screens, return nil if no center toolbar to be shown
def center_toolbar_filename
- Create a ticketCreate a ticket
Class MiqAlertSetController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqAlertSetController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
- Create a ticketCreate a ticket
Class ChargebackRateController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ChargebackRateController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
- Create a ticketCreate a ticket
Class CloudVolumeController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class CloudVolumeController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
- Create a ticketCreate a ticket
Class OrchestrationStackController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class OrchestrationStackController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
- Create a ticketCreate a ticket
Function init
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(dialog) {
var sessionStorageId = requestDialogAction() === 'edit' ?
String(requestDialogId()) : 'new'
var restoredDialog = DialogEditor.restoreSessionStorage(sessionStorageId);
- Create a ticketCreate a ticket
Method perf_gen_top_data_before_wait
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perf_gen_top_data_before_wait
@perf_options[:ght_type] ||= "hybrid"
@perf_options[:chart_type] = :performance
cont_plus_model = request.parameters["controller"] + "-" + @perf_options[:top_model]
metric_model = @perf_options[:top_model] == "Vm" ? "VmOrTemplate" : @perf_options[:top_model]
- Create a ticketCreate a ticket
Method exp_button
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exp_button
@edit = session[:edit]
case params[:pressed]
when "undo", "redo"
@edit[@expkey][:expression] = @edit[@expkey].history.rewind(params[:pressed])
- Create a ticketCreate a ticket
Function miqMenuChangeRow
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.miqMenuChangeRow = function(action, elem) {
var grid = $('#folder_grid .panel-group');
var selected = grid.find('.panel-heading.active').parent();
switch (action) {
- Create a ticketCreate a ticket
Method miq_summary_alert_parameters
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_summary_alert_parameters(alert, expression_options, sb_data, perf_column_unit, ems)
rows = []
title = [_(MiqAlert.expression_types(alert.db)[alert.expression[:eval_method]]), _('Parameters')].join(' ')
data = {:title => title, :mode => "miq_alert_parameters", :rows => []}
ae_options = alert.expression[:options]
- Create a ticketCreate a ticket
Method protect
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def protect
@display = nil
@edit = session[:edit]
if params[:check] # Item was checked/unchecked
- Create a ticketCreate a ticket
Method prov_field_changed
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prov_field_changed
assert_privileges("miq_request_edit")
if params[:tab_id]
@edit = session[:edit]
- Create a ticketCreate a ticket
Method log_depot_edit
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def log_depot_edit
assert_privileges("#{@sb[:selected_typ] == "miq_server" ? "" : "zone_"}log_depot_edit")
@record = @sb[:selected_typ].classify.constantize.find(@sb[:selected_server_id])
# @schedule = nil # setting to nil, since we are using same view for both db_back and log_depot edit
case params[:button]
- Create a ticketCreate a ticket
Function RetirementForm
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const RetirementForm = ({
retirementID, redirect, url, timezone,
}) => {
const retireItems = JSON.parse(retirementID);
const tz = timezone;
- Read upRead up
- Create a ticketCreate a ticket
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"