Showing 2,015 of 18,390 total issues
Method prov_field_changed
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def prov_field_changed
assert_privileges("miq_request_edit")
if params[:tab_id]
@edit = session[:edit]
- 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 buttons_get_node_info
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def buttons_get_node_info(node)
nodetype = node.split("_")
# initializing variables to hold data for selected node
@custom_button = nil
@sb[:button_groups] = nil
- 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 miq_report_edit
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def miq_report_edit
assert_privileges(params[:id] || (@edit && @edit[:rpt_id]) ? "miq_report_edit" : "miq_report_new")
case params[:button]
when "cancel"
if @edit[:rpt_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 widget_get_form_vars
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def widget_get_form_vars
@widget = @edit[:widget_id] ? MiqWidget.find(@edit[:widget_id]) : MiqWidget.new
copy_params_if_set(@edit[:new], params, %i[title description])
@edit[:new][:filter] = params[:filter_typ] if params[:filter_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
File miq_formatters.spec.js
has 583 lines of code (exceeds 400 allowed). Consider refactoring. Open
require('../helpers/miq_formatters_helper.js');
describe('ManageIQ.charts.formatters', () => {
describe('curried/uncurried', () => {
var options = {
- Create a ticketCreate a ticket
Method set_record_vars
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_record_vars(rpt)
# Set the simple string/number fields
rpt.template_type = "report"
rpt.name = @edit[:new][:name].to_s.strip
rpt.title = @edit[:new][:title].to_s.strip
- Create a ticketCreate a ticket
Class StorageController
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
class StorageController < ApplicationController
include StorageD
include StoragePod
include Mixins::GenericSessionMixin
include Mixins::GenericShowMixin
- Create a ticketCreate a ticket
File schema.js
has 578 lines of code (exceeds 400 allowed). Consider refactoring. Open
import { componentTypes, validatorTypes } from '@@ddf';
import {
loadPlayBookOptions,
transformObjectToSelectOptions,
transformCurrenciesOptions,
- Create a ticketCreate a ticket
Method exp_commit_find
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def exp_commit_find(exp)
if @edit[@expkey][:exp_field].nil?
add_flash(_("A find field must be chosen to commit this expression element"), :error)
elsif %w[checkall checkany].include?(@edit[@expkey][:exp_check]) &&
@edit[@expkey][:exp_cfield].nil?
- 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 automate_button_field_changed
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def automate_button_field_changed
assert_privileges(feature_by_action)
unless params[:target_class]
@edit = session[:edit]
- 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_reconfigure_hash
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def build_reconfigure_hash(reconfigure_ids)
@req = nil
@reconfig_values = {}
if @request_id == 'new'
@reconfig_values = get_reconfig_info(reconfigure_ids)
- 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 menus.rb
has 574 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ReportController::Menus
extend ActiveSupport::Concern
def get_tree_data
# build tree for selected role in left div of the right cell
- Create a ticketCreate a ticket
Class InfraNetworkingController
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class InfraNetworkingController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
- Create a ticketCreate a ticket
Function createSchema
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (edit, ems, initialValues, state, setState, familyId, setFamilyId) => {
let emsId = state.ems_id;
let providerCapabilities;
if (initialValues && initialValues.ems_id) {
emsId = initialValues.ems_id;
- Create a ticketCreate a ticket
Method protect
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def protect
@display = nil
@edit = session[:edit]
if params[:check] # Item was checked/unchecked
- 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 replace_right_cell
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def replace_right_cell(options = {})
nodetype, replace_trees = options.values_at(:nodetype, :replace_trees)
replace_trees = @replace_trees if @replace_trees # get_node_info might set this
# FIXME
- 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_form_vars
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings_get_form_vars
settings_load_edit
return unless @edit
@in_a_form = true
- Create a ticketCreate a ticket
Method replace_right_cell
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
def replace_right_cell(options = {})
if params[:action] == 'x_history'
# Making selected checkboxes array empty when compare cancel is clicked
params[:miq_grid_checks] = []
end
- Create a ticketCreate a ticket
Function ReconfigureVmForm
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const ReconfigureVmForm = ({
recordId, requestId, roles, options, memory,
}) => {
const [data, setData] = useState({
initialValues: {},
- 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 perf_chart_chooser
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def perf_chart_chooser
assert_privileges("perf_reload")
@record = identify_tl_or_perf_record
@perf_record = @record.kind_of?(MiqServer) ? @record.vm : @record # Use related server vm record
- 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"