Showing 18,390 of 18,390 total issues
Method miq_summary_rbac_details
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_summary_rbac_details(users, groups, roles, tenants)
data = {:title => _("Access control"), :mode => "miq_access_control"}
rows = []
if role_allows?(:feature => "rbac_user_view", :any => true)
rows.push({
- Create a ticketCreate a ticket
Method center_toolbar_filename_pxe
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def center_toolbar_filename_pxe
if x_active_tree == :pxe_servers_tree
if x_node == "root"
return "pxe_servers_center_tb"
elsif x_node.split('-').first == "pi"
- Create a ticketCreate a ticket
Method explorer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def explorer
@explorer = true
@trees = []
return if perfmenu_click?
- Create a ticketCreate a ticket
Method git_refresh
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def git_refresh
@in_a_form = true
@explorer = true
session[:changed] = true
- Create a ticketCreate a ticket
Method policy_edit_save
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def policy_edit_save
assert_privileges("miq_policy_#{@policy.id ? "edit" : "new"}")
policy = @policy.id.blank? ? MiqPolicy.new : MiqPolicy.find(@policy.id) # Get new or existing record
policy.mode = @edit[:new][:mode]
policy.updated_by = session[:userid]
- Create a ticketCreate a ticket
Method ap_show
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ap_show
# identify_scanitemset
if @selected_scan.nil?
flash_to_session(_("Error: Record no longer exists in the database"), :error)
redirect_to(:action => 'show_list_set')
- Create a ticketCreate a ticket
Method resizevms
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resizevms
case params[:pressed]
when "instance_resize"
assert_privileges("instance_resize")
when "miq_request_edit"
- Create a ticketCreate a ticket
Method set_form_vars
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_form_vars
case @tabform
when 'ui_1'
@edit = {
:current => {},
- Create a ticketCreate a ticket
Method get_form_vars
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_form_vars
copy_params_if_present(@edit[:new], params, %i[st_prov_type name description provision_cost catalog_id dialog_id generic_subtype long_description zone_id price retire_fqname reconfigure_fqname fqname])
@edit[:new][:display] = params[:display] == "1" if params[:display] # @edit[:new][:display] should't be changed if params[:display] is not set
# saving it in @edit as well, to use it later because prov_set_form_vars resets @edit[:new]
- Create a ticketCreate a ticket
Method import
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import
assert_privileges('policy_import_export')
@breadcrumbs = []
@layout = "miq_policy_export"
@import_file_upload_id = params[:import_file_upload_id]
- Create a ticketCreate a ticket
Method alert_set_record_vars
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def alert_set_record_vars(alert)
alert.description = @edit[:new][:description]
alert.enabled = @edit[:new][:enabled]
alert.severity = @edit[:new][:severity]
alert.db = @edit[:new][:db]
- Create a ticketCreate a ticket
Method show_list
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show_list
@breadcrumbs = []
bc_name = _("Requests")
@request_tab = params[:typ] if params[:typ] # set this to be used to identify which Requests subtab was clicked
@layout = layout_from_tab_name(@request_tab)
- Create a ticketCreate a ticket
Method prov_continue
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prov_continue
assert_privileges("miq_request_edit")
if params[:button] == "continue" # Continue the request from the workflow with the new options
id = params[:id] || "new"
return unless load_edit("prov_edit__#{id}", "show_list")
- Create a ticketCreate a ticket
Method attributes_data
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attributes_data
attributes = %i[cloud_object_store_containers miq_templates vms security_groups cloud_networks cloud_subnets network_ports cloud_volumes]
attr_icon = {
:cloud_object_store_containers => 'ff ff-cloud-object-store',
- Create a ticketCreate a ticket
Method attributes_data
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attributes_data
attributes = %i[flavors cloud_tenants miq_templates vms availability_zones security_groups cloud_networks cloud_volumes]
attr_icon = {
:flavors => "pficon pficon-flavor",
- Create a ticketCreate a ticket
Function newInstance
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function newInstance(name, initialProps = {}, mountTo = undefined) {
// clean all left over components
cleanVirtualDom();
// validate inputs
const definition = getDefinition(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
Function MiqCustomTab
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const MiqCustomTab = ({ containerId, tabLabels, type }) => {
const dispatch = useDispatch();
const [data, setData] = useState({ loading: false });
/** Labels used for a Tab found from the '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
Function WidgetWrapper
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const WidgetWrapper = ({
widgetId, widgetType, widgetButtons, widgetLastRun, widgetNextRun, widgetTitle,
}) => {
const [{
widgetModel, href, isLoading, showConfirm, error,
- 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 TerraformTemplateCatalogForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const TerraformTemplateCatalogForm = ({ initialData }) => {
const [data, setData] = useState({
isLoading: true,
formData: {},
currencies: [],
- 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 select_by_servers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def select_by_servers(record)
if record.instance_of?(MiqServer)
select_server_details(record)
else
data = {:mode => "selected_server_role_details"}
- 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"