Showing 2,015 of 18,390 total issues
Method build_edit_screen
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def build_edit_screen
build_tabs
get_time_profiles # Get time profiles list (global and user specific)
cb_entities_by_provider if Chargeback.db_is_chargeback?(@edit[:new][:model]) && [ChargebackContainerImage, ChargebackContainerProject, MeteringContainerImage, MeteringContainerProject].include?(@edit[:new][:model].safe_constantize)
- 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 show
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show(id = nil)
@flash_array = [] if params[:display] && params[:display] != "snapshot_info"
@sb[:action] = params[:display]
return if perfmenu_click?
- Create a ticketCreate a ticket
File textual_summary.rb
has 519 lines of code (exceeds 400 allowed). Consider refactoring. Open
module VmHelper::TextualSummary
include TextualMixins::TextualAdvancedSettings
include TextualMixins::TextualDescription
include TextualMixins::TextualDrift
include TextualMixins::TextualFilesystems
- Create a ticketCreate a ticket
Function miqBrowserDetect
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.miqBrowserDetect = function() {
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || 'An unknown browser';
this.version = this.searchVersion(navigator.userAgent) ||
- Create a ticketCreate a ticket
File dashboard_controller.rb
has 518 lines of code (exceeds 400 allowed). Consider refactoring. Open
class DashboardController < ApplicationController
include Mixins::BreadcrumbsMixin
include DashboardHelper
include Mixins::StartUrl
- Create a ticketCreate a ticket
Method included
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(included_class)
included_class.button_group('instance_operations', [
included_class.select(
:instance_power_choice,
nil,
- Create a ticketCreate a ticket
Method alert_field_changed
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
def alert_field_changed
return unless load_edit("miq_alert_edit__#{params[:id]}")
@alert = @edit[:alert_id] ? MiqAlert.find(@edit[:alert_id]) : MiqAlert.new
- Create a ticketCreate a ticket
Function GroupForm
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
const GroupForm = ({
recId, availableFields, fields, url, appliesToClass, appliesToId, isGenericObject,
}) => {
const [{
isLoading, initialValues, buttonIcon, options,
- 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 prov_set_show_vars
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def prov_set_show_vars
@showtype = "main"
@options = @miq_request.get_options # Get the provision options from the request record
@options[:org_controller] = "vm"
if @options[:schedule_time]
- 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_dates
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def set_dates(start_date, end_date, allow_interval_override)
tz = time_profile_tz || self.tz # Use time profile tz or chosen tz, if no profile tz
self.sdate = start_date.in_time_zone(tz)
self.edate = end_date.in_time_zone(tz)
self.sdate_daily = sdate.hour.zero? ? sdate : sdate + 1.day
- 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_node_info
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def get_node_info(treenodeid, refresh = nil)
treenodeid = valid_active_node(treenodeid)
get_nodetype_and_record(treenodeid)
@right_cell_text = if @record.kind_of?(MiqEnterprise)
_('Enterprise')
- 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 log_depot_edit
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def log_depot_edit
assert_privileges("#{@sb[:selected_typ] == "miq_server" ? "" : "zone_"}log_depot_edit")
@record = @sb[:selected_typ].classify.constantize.find(@sb[:selected_server_id])
# @schedule = nil # setting to nil, since we are using same view for both db_back and log_depot edit
case params[:button]
- 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
Class GenericObjectDefinitionController
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class GenericObjectDefinitionController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
- Create a ticketCreate a ticket
Class ExplorerPresenter
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class ExplorerPresenter
include ApplicationHelper
include JsHelper
include ActionView::Helpers::JavaScriptHelper
- Create a ticketCreate a ticket
File ems_common.rb
has 511 lines of code (exceeds 400 allowed). Consider refactoring. Open
module Mixins
module EmsCommon
extend ActiveSupport::Concern
# This is the list of extracted parts that can be used separately
- Create a ticketCreate a ticket
Function processReplaceRightCell
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
ManageIQ.explorer.processReplaceRightCell = function(data) {
/* variables for the expression editor */
if (_.isObject(data.expEditor)) {
if (_.isObject(data.expEditor.first)) {
if (!_.isUndefined(data.expEditor.first.type)) {
- Create a ticketCreate a ticket
Method center_toolbar_filename_classic
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
def center_toolbar_filename_classic
# Original non vmx view code follows
# toolbar buttons on sub-screens
to_display = %w[availability_zones cloud_networks cloud_object_store_containers cloud_subnets configured_systems
cloud_tenants cloud_volumes cloud_volume_snapshots ems_clusters flavors floating_ips host_aggregates hosts host_initiators host_initiator_groups
- Create a ticketCreate a ticket
Function hostData
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const hostData = () => {
const columns = [
{ is_narrow: true, header_text: '' },
{
text: 'Name', sort: 'str', col_idx: 0, align: 'left', header_text: 'Name',
- Create a ticketCreate a ticket
Method prov_get_form_vars
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prov_get_form_vars
if params[:ids_checked] # User checked/unchecked a tree node
ids = params[:ids_checked]
# for some reason if tree is not expanded clicking on radiobuttons this.getAllChecked() sends up extra blanks
@edit.store_path(:new, tag_symbol_for_workflow, ids.select(&:present?).collect(&:to_i))
- Create a ticketCreate a ticket
Function GtlView
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const GtlView = ({
flashMessages,
additionalOptions,
modelName,
activeTree,
- 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"