Showing 2,015 of 18,390 total issues
Method exp_button
has a Cognitive Complexity of 31 (exceeds 5 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])
- 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 schedule_edit
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def schedule_edit
assert_privileges("schedule_edit")
case params[:button]
when "cancel"
@schedule = MiqSchedule.find_by(:id => params[: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_form_vars
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def set_form_vars
@edit = {
:cb_rates => {},
:cb_assign => {},
}
- 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 schedule_set_form_vars
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def schedule_set_form_vars
@timezone_abbr = get_timezone_abbr
@edit = {}
@folders = []
- 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 settings_form_field_changed
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings_form_field_changed
assert_privileges("ops_settings")
settings_get_form_vars
return unless @edit
- Create a ticketCreate a ticket
Function createSchema
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSchema(fieldss, recordId, emsId, mode, loadSchema, alertState, alertOptions) {
let selectedOptions = []; // in edit form, selectedOptions are options that are passed in when open the form for first time
let editSelectedOptions = []; // in edit form, editSelectedOptions recorded all the selected options once the form is changed
let selectedOptionsChanged = false; // in edit form, selectedOptionsChanged changes to true once there is a change in selected options
- Create a ticketCreate a ticket
Class ToolbarBuilder
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationHelper::ToolbarBuilder
include MiqAeClassHelper
include RestfulControllerMixin
include ApplicationHelper::Toolbar::Mixins::CustomButtonToolbarMixin
- Create a ticketCreate a ticket
Class MiqTaskController
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqTaskController < 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 MiqAeCustomizationController
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqAeCustomizationController < ApplicationController
require "English"
include CustomButtons
include OldDialogs
include Dialogs
- Create a ticketCreate a ticket
Function createSchema
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (fields, edit, ems, loadSchema, emptySchema) => {
const idx = fields.findIndex((field) => field.name === 'required_capabilities');
const supports = edit ? 'supports_storage_services' : 'supports_storage_service_create';
let providerCapabilities;
- Create a ticketCreate a ticket
Function MainMenu
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const MainMenu = ({
applianceName,
brandUrl,
currentGroup,
currentUser,
- 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 DashboardWidget
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const DashboardWidget = ({ data, id, title }) => {
const convertedData = getConvertedData(data);
let showLegend = true;
const nameTable = data.miq.name_table;
if (convertedData.length > 0 && data.miq) {
- 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_ce_delete
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def ap_ce_delete
assert_privileges("ap_delete")
return unless load_edit("ap_edit__#{params[:id]}", "replace_cell__explorer")
- 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 settings_get_info
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def settings_get_info(nodetype = x_node)
nodes = nodetype.downcase.split("-")
case nodes[0]
when "root"
@right_cell_text = _("%{product} Region \"%{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 build_search_filter_from_params
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def build_search_filter_from_params(schedule, filter_type, value, other_value)
resource_type = schedule.resource_type
check_compliance = schedule&.sched_action&.dig(:method) == "check_compliance"
filter_resource_type = if check_compliance
if resource_type == "ContainerImage"
- 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_view_process_search_text
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def get_view_process_search_text(view)
# Check for new search by name text entered
if params[:search]
@search_text = params[:search][:text].blank? ? nil : params[:search][:text].strip
elsif params[:search_text] && @explorer
- 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 onClick
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const onClick = (button) => {
let buttonUrl;
if (button.confirm && !window.confirm(button.confirm)) {
// No handling unless confirmed.
- 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 catalog_basic_information
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def catalog_basic_information(record, sb_params, tenants_tree)
prov_types = catalog_provision_types
prov_data = [prov_types[:template], prov_types[:ovf]].include?(record.prov_type) && (catalog_provision?(record, :playbook) || catalog_provision?(record, :terraform_template)) ? provisioning : nil
data = {:title => _('Basic Information'), :mode => "miq_catalog_basic_information"}
rows = []
- 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 build_download_rpt
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def build_download_rpt(cols, csv, typ)
if typ.nil? || typ == "all"
if csv # If generating CSV, remove * from data
cols.each_with_index do |c, i|
if c.to_s.starts_with?("* ")
- 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 exp_add_joiner
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def exp_add_joiner(exp, token, joiner)
if exp[:token] && exp[:token] == token # If the token matches
exp.keys.each do |key| # Find the key
if key == :token
exp.delete(key) # Remove the :token key
- 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"