Showing 2,015 of 18,390 total issues
Method data_for_breadcrumbs
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
def data_for_breadcrumbs(controller_options = {})
options = breadcrumbs_options || {}
options[:record_info] ||= (@record || {})
options[:record_title] ||= :name
options[:not_tree] ||= false
- 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 button
has 270 lines of code (exceeds 25 allowed). Consider refactoring. Open
def button
@edit = session[:edit] # Restore @edit for adv search box
params[:display] = @display if ["vms", "hosts", 'host_aggregates', "storages", "instances", "images", "orchestration_stacks"].include?(@display) # Were we displaying vms/hosts/storages
params[:page] = @current_page unless @current_page.nil? # Save current page for list refresh
- Create a ticketCreate a ticket
Function aeMethodFormController
has 268 lines of code (exceeds 25 allowed). Consider refactoring. Open
function aeMethodFormController($http, $scope, aeMethodFormId, currentRegion, miqService, playbookReusableCodeMixin, location, API) {
var vm = this;
var init = function() {
vm.aeMethodModel = {
name: '',
- Create a ticketCreate a ticket
Method set_form_locals
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def set_form_locals
locals = {}
if x_active_tree == :diagnostics_tree
if @sb[:active_tab] == "diagnostics_cu_repair"
action_url = "cu_repair"
- 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 valid_report?
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def valid_report?(rpt)
active_tab = 'edit_1'
if @edit[:new][:model] == ApplicationController::TREND_MODEL
unless @edit[:new][:perf_trend_col]
add_flash(_('Trending for is required'), :error)
- 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_field_changed
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def alert_field_changed
return unless load_edit("miq_alert_edit__#{params[:id]}")
@alert = @edit[:alert_id] ? MiqAlert.find(@edit[:alert_id]) : MiqAlert.new
- 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 widget_set_form_vars
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def widget_set_form_vars
@timezone_abbr = get_timezone_abbr
@edit = {}
@edit[:widget_id] = @widget.id
@edit[:read_only] = !!@widget.read_only
- 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
File ops_controller.rb
has 743 lines of code (exceeds 400 allowed). Consider refactoring. Open
class OpsController < ApplicationController
# Methods for accordions
include Diagnostics
include OpsRbac
include Settings
- Create a ticketCreate a ticket
Method gfv_sort
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def gfv_sort
@edit[:new][:order] = params[:sort_order] if params[:sort_order]
if params[:sort_group] # If grouping changed,
@edit[:new][:group] = params[:sort_group]
@refresh_div = "sort_div" # Resend the sort tab
- 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
Function playbookReusableCodeMixin
has 252 lines of code (exceeds 25 allowed). Consider refactoring. Open
function playbookReusableCodeMixin(API, $q, miqService) {
var sortOptions = '&sort_by=name&sort_order=ascending';
var allApiPromises = [];
var getSortedHash = function(inputHash) {
- Create a ticketCreate a ticket
Method set_form_vars
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def set_form_vars
@edit = {}
@edit[:rpt_id] = @rpt.id # Save a record id to use it later to look a record
@edit[:rpt_title] = @rpt.title
@edit[:rpt_name] = @rpt.name
- 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_valid_record?
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def alert_valid_record?(alert)
if alert.expression.nil?
add_flash(_("A valid expression must be present"), :error)
end
unless display_driving_event?
- 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
Function createSchema
has 245 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (state, setState, ems, initialValues, storageId, setStorageId) => {
let emsId = state.ems_id;
if (initialValues && initialValues.ems_id) {
emsId = initialValues.ems_id;
}
- Create a ticketCreate a ticket
Method perf_gen_charts
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def perf_gen_charts(rpt, perf_options, parent = false)
model_title = parent ? "Parent-#{perf_options[:parent]}" : perf_options[:model]
charts = []
chart_data = []
case perf_options[:typ]
- 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
Function addSchema
has 237 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addSchema = (formValues) => {
const basicOptions = generateBasicOptions();
const rangeNine = generateRange(10);
const rangeFour = generateRange(5);
const rangeFive = generateRange(6);
- Create a ticketCreate a ticket
Method workflow_instance_from_vars
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def workflow_instance_from_vars(req)
options = {}
pre_prov_values = nil
if %w[miq_template service_template vm].include?(@edit[:org_controller])
if params[:prov_type] && !req # only do this new requests
- 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
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def show(id = nil)
@flash_array = [] if params[:display] && params[:display] != "snapshot_info"
@sb[:action] = params[:display]
return if perfmenu_click?
- 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 diagnostics_set_form_vars
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def diagnostics_set_form_vars
active_node = x_node
if active_node && active_node.split('-').first == "z"
@record = @selected_server = Zone.find_by(:id => active_node.split('-').last)
@sb[:selected_server_id] = @selected_server.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 set_global_session_data
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def set_global_session_data
@sb ||= {}
# Set all of the global variables used by most of the controllers
session[:layout] = @layout
session[:panels] = @panels
- 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 prov_set_form_vars
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def prov_set_form_vars(req = nil)
@edit ||= {}
session[:prov_options] = @options = nil # Clearing out options that were set on show screen
@edit[:req_id] = req.try(:id) # Save existing request record id, if passed in
@edit[:key] = "prov_edit__#{@edit[:req_id] || "new"}"
- 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"