Showing 2,015 of 18,390 total issues
Method alert_valid_record?
has 93 lines of code (exceeds 25 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?
- Create a ticketCreate a ticket
Method miq_summary_action_type
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_summary_action_type(record, alert_guids, cats)
record_options = record.options
data = {:mode => "miq_action_type", :rows => [], :title => ""}
rows = []
case record.action_type
- Create a ticketCreate a ticket
Class ServiceController
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class ServiceController < ApplicationController
include Mixins::GenericSessionMixin
include Mixins::GenericShowMixin
include Mixins::GenericListMixin
include Mixins::BreadcrumbsMixin
- Create a ticketCreate a ticket
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
data, dialogClassName, hideModal,
} = this.props;
const { show } = this.props;
- Create a ticketCreate a ticket
File infra_networking_controller.rb
has 466 lines of code (exceeds 400 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
Method build_automate_tree
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def build_automate_tree(type)
tree_name = "#{type}_tree".to_sym
# build the ae tree to show the tree select box for entry point
if x_active_tree == tree_name && @edit && @edit[:new][:fqname]
- 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 prefill_val_types
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def prefill_val_types
self.val1 ||= {}
self.val2 ||= {}
val1[:type] = case exp_typ
when '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 replace_right_cell
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def replace_right_cell(options = {})
@explorer = true
replace_trees = options[:replace_trees]
# FIXME: is the following line needed?
- 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 timeprofile_set_days_hours
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def timeprofile_set_days_hours(_timeprofile = @timeprofile)
@timeprofile_details = {}
@timeprofiles.each do |timeprofile|
@timeprofile_details[timeprofile.description] = {}
profile_key = timeprofile.profile[:days].nil? ? "days" : :days
- 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_schedule_options_for_select
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def build_schedule_options_for_select
@action_type_options_for_select = [
[_("VM Analysis"), "vm"],
[_("Template Analysis"), "miq_template"],
[_("Host Analysis"), "host"],
- 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_user_delete
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def rbac_user_delete
assert_privileges("rbac_user_delete")
users = []
if params[:id] # showing a list
if params[:id].nil? || !User.exists?(: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 provision_dialogs_update_create
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def provision_dialogs_update_create
case params[:button]
when "add", "save"
dialog = params[:id].blank? ? MiqDialog.new : MiqDialog.find(params[:id]) # Get new or existing record
if params[:name].blank?
- 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 reports_get_node_info
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def reports_get_node_info
nodes = x_node.split('-')
if nodes.length == 2
@right_cell_text ||= _("%{typ} Reports") % {:typ => @sb[:rpt_menu][nodes[1].to_i][0]}
- 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 menu_set_reports_for_group
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def menu_set_reports_for_group
@edit[:new].each do |r|
r.each_slice(2) do |menu, section|
title = "#{menu}/"
next if section.nil? || section.class == String
- 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 gtl-view.jsx
has 465 lines of code (exceeds 400 allowed). Consider refactoring. Open
/* eslint-disable no-nested-ternary */
/* eslint-disable react/prop-types */
/* eslint-disable no-console */
import React, { useEffect, useReducer } from 'react';
import PropTypes from 'prop-types';
- Create a ticketCreate a ticket
Method view_to_url
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def view_to_url(view, parent = nil)
association = view_to_association(view, parent)
if association.nil?
controller, action = db_to_controller(view.db)
if controller == "ems_cloud" && action == "show"
- Create a ticketCreate a ticket
Method settings_update_save
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings_update_save
settings_get_form_vars
return unless @edit
case @sb[:active_tab]
- Create a ticketCreate a ticket
Method at_tree_select_toggle
has 88 lines of code (exceeds 25 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.
- Create a ticketCreate a ticket
Method st_get_form_vars
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
def st_get_form_vars
get_form_vars
if params[:resource_id]
# adding new service resource, so need to lookup actual vm or service template record and set defaults
sr = ServiceTemplate.find(params[:resource_id])
- Create a ticketCreate a ticket
Method show
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
assert_privileges("dashboard_view")
@layout = "dashboard"
@display = "dashboard"
@lastaction = "show"
- Create a ticketCreate a ticket