Showing 2,015 of 18,390 total issues
Function gtlReducer
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const gtlReducer = (state, action) => {
switch (action.type) {
case 'dataLoaded':
if (state && state.additionalOptions && state.additionalOptions.checkboxes_clicked
&& state.additionalOptions.checkboxes_clicked.length === 0) {
- Create a ticketCreate a ticket
Method textual_group_endpoints
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def textual_group_endpoints
endpoints = @record.endpoints.where.not(:role => 'default')
return if endpoints.nil?
endpoints_types = {
- Create a ticketCreate a ticket
Method policy_build_edit_screen
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def policy_build_edit_screen(edit_type = nil)
@edit = {}
@edit[:new] = {}
@edit[:current] = {}
@edit[:key] = "miq_policy_edit__#{@policy.id || "new"}"
- Create a ticketCreate a ticket
Method fields_seq_edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fields_seq_edit
assert_privileges("miq_ae_field_seq")
case params[:button]
when "cancel"
@sb[:action] = session[:edit] = nil # clean out the saved info
- Create a ticketCreate a ticket
Method rbac_group_user_lookup
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rbac_group_user_lookup
assert_privileges(params[:id] == "new" ? "rbac_group_add" : "rbac_group_edit")
rbac_group_user_lookup_field_changed
- Create a ticketCreate a ticket
Method build_filtered_item_list
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_filtered_item_list(action_type, filter_type)
case filter_type
when "vm"
filtered_item_list = find_filtered(Vm).sort_by { |vm| vm.name.downcase }.collect(&:name).uniq
when "miq_template"
- Create a ticketCreate a ticket
Method button
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def button
@edit = session[:edit] # Restore @edit for adv search box
params[:display] = @display if %w[vms images instances].include?(@display)
params[:page] = @current_page unless @current_page.nil? # Save current page for list refresh
- Create a ticketCreate a ticket
Method pxe_wimg_edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pxe_wimg_edit
assert_privileges("pxe_wimg_edit")
case params[:button]
when "cancel"
add_flash(_("Edit of Windows Image \"%{name}\" was cancelled by the user") % {:name => session[:edit][:wimg].name})
- Create a ticketCreate a ticket
Method explorer
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def explorer
@explorer = true
@lastaction = "explorer"
@timeline = @timeline_filter = true # need to set these to load timelines on vm show screen
if params[:menu_click] # Came in from a chart context menu click
- Create a ticketCreate a ticket
Method move_cols_left
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def move_cols_left
if params[:selected_fields].blank? || params[:selected_fields][0] == ""
add_flash(_("No fields were selected to move up"), :error)
elsif display_filter_contains?(params[:selected_fields])
add_flash(_("No fields were moved up"), :error)
- Create a ticketCreate a ticket
Method get_global_session_data
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_global_session_data
# Set the current userid in the User class for this thread for models to use
User.current_user = current_user
# if session group for user != database group for the user then ensure it is a valid group
if current_user.try(:current_group_id_changed?) && !current_user.miq_groups.include?(current_group)
- Create a ticketCreate a ticket
Method set_form_locals
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_form_locals
locals = {}
if x_active_tree == :export_tree
locals[:no_reset] = locals[:no_cancel] = locals[:multi_record] = true
if x_node == "xx-exportwidgets"
- Create a ticketCreate a ticket
Method widget_form_field_changed
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def widget_form_field_changed
assert_privileges(feature_for_widget_action)
return unless load_edit("widget_edit__#{params[:id]}", "replace_cell__explorer")
widget_get_form_vars
- Create a ticketCreate a ticket
Function prepareRequestObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const prepareRequestObject = (values, formId) => {
const requestObject = { ...values };
// if price property is not there add price property if its present convert the value into string
if (!Object.prototype.hasOwnProperty.call(requestObject, 'price')) {
- 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 actionsToFunction
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
actionsToFunction: function() {
var startEnd = function(pageNumber) {
var start = (pageNumber - 1) * this.settings.perpage;
var end = start + this.settings.perpage;
return {
- 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 getTextValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const getTextValue = (cellValue) => {
if (isNull(cellValue)) {
return '';
}
if (isObject(cellValue)) {
- 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 normalize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const normalize = (tree, fn) => tree.map((n) => {
let node = { ...n };
if (node.class) {
node = { ...node, classes: node.class };
delete node.class;
- 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 linkProps
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const linkProps = ({
type, href, id, hideSecondary = () => null,
}) => ({
href: {
big_iframe: `/dashboard/iframe?id=${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
Function convertMultParamsToRailsMultParams
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function convertMultParamsToRailsMultParams(fullParamString) {
const keyValuePairsArr = [];
if (fullParamString) {
fullParamString.split('&').forEach((element) => {
if (element) {
- 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 NetworkFloatingIPsForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const NetworkFloatingIPsForm = ({
recordId,
}) => {
const [{
ems, initialValues, isLoading, fields,
- 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"