Showing 2,015 of 18,390 total issues
File miq_alert_controller.rb
has 632 lines of code (exceeds 400 allowed). Consider refactoring. Open
class MiqAlertController < 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 retirementTabSchema
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
const retirementTabSchema = (
repositories,
setData,
retirementRepositoryId,
currentRegion,
- Create a ticketCreate a ticket
Function provisionTabSchema
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
const provisionTabSchema = (
repositories,
setData,
provisionRepositoryId,
currentRegion,
- Create a ticketCreate a ticket
Method build_grid
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def build_grid
case @edit[:wf]
when MiqProvisionConfiguredSystemWorkflow
build_dialog_page_miq_provision_configured_system_workflow
when MiqProvisionVirtWorkflow
- 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 ap_get_form_vars
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def ap_get_form_vars
@scan = @edit[:scan_id] ? ScanItemSet.find(@edit[:scan_id]) : ScanItemSet.new
@edit[:new][:name] = params[:name] if params[:name]
@edit[:new][:description] = params[:description] if params[:description]
- 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 list_child_vms
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def list_child_vms(model, node_id, title, show_list)
options = {
:model => model,
:named_scope => scopes_for_role,
}
- 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 action_field_changed
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def action_field_changed
return unless load_edit("miq_action_edit__#{params[:id]}")
@action = @edit[:action_id] ? MiqAction.find(@edit[:action_id]) : MiqAction.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 update_from_expression_editor
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_from_expression_editor(params)
if params[:chosen_typ] && params[:chosen_typ] != exp_typ
change_exp_typ(params[:chosen_typ])
else
case exp_typ
- Create a ticketCreate a ticket
Function actionsToFunction
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
actionsToFunction: function() {
var startEnd = function(pageNumber) {
var start = (pageNumber - 1) * this.settings.perpage;
var end = start + this.settings.perpage;
return {
- Create a ticketCreate a ticket
Function processReplaceRightCell
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
ManageIQ.explorer.processReplaceRightCell = function(data) {
/* variables for the expression editor */
if (_.isObject(data.expEditor)) {
if (_.isObject(data.expEditor.first)) {
if (!_.isUndefined(data.expEditor.first.type)) {
- 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 at_tree_select_toggle
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def at_tree_select_toggle(type, edit_key)
automation_type = params[:automation_type] || default_entry_point_type
if edit_key
current_entry_point = @edit[:new][edit_key] # before updating @edit varibale.
- 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 get_method_form_vars
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def get_method_form_vars
@ae_method = @edit[:ae_method_id] ? MiqAeMethod.find(@edit[:ae_method_id]) : MiqAeMethod.new
@in_a_form = true
if params[:item].blank? && params[:button] != "accept" && params["action"] != "field_delete"
# for method_inputs view
- 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 rbac_group_get_form_vars
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def rbac_group_get_form_vars
if %w[up down].include?(params[:button])
move_cols_up if params[:button] == "up"
move_cols_down if params[:button] == "down"
else
- 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_right_cell_vars
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_right_cell_vars(options = {})
name = @record.try(:name).to_s
table = request.parameters["controller"]
case @sb[:action]
when "attach"
- Create a ticketCreate a ticket
Method set_form_vars
has 172 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
Method update_from_exp_tree
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def update_from_exp_tree(exp)
exp.delete(:token)
key = exp.keys.first
if exp[key]['field']
typ = 'field'
- 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 add_field_to_col_order
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def add_field_to_col_order(rpt, field)
# Get the sort columns, removing the suffix if it exists
sortby1 = if MiqReport.is_break_suffix?(@edit[:new][:sortby1].split("__")[1])
@edit[:new][:sortby1].split("__").first
else
- 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 a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
function playbookReusableCodeMixin(API, $q, miqService) {
var sortOptions = '&sort_by=name&sort_order=ascending';
var allApiPromises = [];
var getSortedHash = function(inputHash) {
- 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 db_edit
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def db_edit
assert_privileges("db_edit")
case params[:button]
when "cancel"
- 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 RoutersForm
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
const RoutersForm = ({ routerId }) => {
const [{
initialValues, isLoading, fields, subnets,
}, setState] = useState({
isLoading: !!routerId, fields: [], subnetSelect: [], subnets: [],
- 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"