Showing 2,015 of 18,390 total issues
Function SubnetForm
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const SubnetForm = ({ recordId }) => {
const [{ initialValues, isLoading, fields }, setState] = useState({ isLoading: !!recordId, fields: [] });
const submitLabel = !!recordId ? __('Save') : __('Add');
const loadSchema = (appendState = {}) => ({ data: { form_schema: { 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"
Further reading
Method perf_gen_top_data_before_wait
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def perf_gen_top_data_before_wait
@perf_options[:ght_type] ||= "hybrid"
@perf_options[:chart_type] = :performance
cont_plus_model = request.parameters["controller"] + "-" + @perf_options[:top_model]
metric_model = @perf_options[:top_model] == "Vm" ? "VmOrTemplate" : @perf_options[:top_model]
- 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 button
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def button
@edit = session[:edit] # Restore @edit for adv search box
params[:page] = @current_page unless @current_page.nil? # Save current page for list refresh
@refresh_div = "main_div" # Default div for button.rjs to refresh
- 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 button
has a Cognitive Complexity of 22 (exceeds 5 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
- 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 deleteemss
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def deleteemss
assert_privileges(params[:pressed])
emss = []
if @lastaction == "show_list" # showing a list, scan all selected emss
emss = find_checked_items
- 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 schedule_form_field_changed
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def schedule_form_field_changed
assert_privileges(@edit && @edit[:rpt_id] ? "miq_report_schedule_edit" : "miq_report_schedule_add")
return unless load_edit("schedule_edit__#{params[:id]}", "replace_cell__explorer")
schedule_get_form_vars
- 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 stamp
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def stamp
assert_privileges(rbac_feature_id("miq_request_approval"))
if params[:button] == "cancel"
if (session[:edit] && session[:edit][:stamp_typ]) == "a"
flash_to_session(_("Request approval was cancelled by the user"))
- 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_validate_entries
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def widget_validate_entries
if %w[r c].include?(@sb[:wtype]) && (!@edit[:new][:repfilter] || @edit[:new][:repfilter] == "")
add_flash(_("A Report must be selected"), :error)
end
if %w[role group].include?(@edit[:new][:visibility_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
Function link
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, elem, attr, ctrl) {
scope['formchange_' + ctrl.$name] = elem[0].name;
scope['elemType_' + ctrl.$name] = attr.type;
var model = function() {
- Create a ticketCreate a ticket
Method atomic_form_field_changed
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def atomic_form_field_changed
assert_privileges(session&.fetch_path(:edit, :rec_id) ? "atomic_catalogitem_edit" : "atomic_catalogitem_new")
# need to check req_id in session since we are using common code for prov requests and atomic ST screens
id = session[:edit][:req_id] || "new"
- Create a ticketCreate a ticket
Method valid_report?
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def valid_report?(rpt)
active_tab = 'edit_1'
if @edit[:new][:model] == ApplicationController::TREND_MODEL
unless @edit[:new][:perf_trend_col]
add_flash(_('Trending for is required'), :error)
- Create a ticketCreate a ticket
Function getNetworkChart
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getNetworkChart = (isLoading, dashboardData) => {
if (isLoading !== true) {
if (dashboardData.data.network_metrics.dataAvailable) {
const chartData = [];
let count = 0;
- Create a ticketCreate a ticket
Method set_global_session_data
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_global_session_data
@sb ||= {}
# Set all of the global variables used by most of the controllers
session[:layout] = @layout
session[:panels] = @panels
- Create a ticketCreate a ticket
Function setConfigInfo
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setConfigInfo = function(configData) {
var catalog_item = {
name: configData.name,
description: configData.description,
long_description: configData.long_description,
- Create a ticketCreate a ticket
Class EmsInfraController
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class EmsInfraController < ApplicationController
include Mixins::GenericListMixin
include Mixins::GenericShowMixin
include Mixins::EmsCommon # common methods for EmsInfra/Cloud controllers
include Mixins::DashboardViewMixin
- Create a ticketCreate a ticket
Function getMemoryChart
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getMemoryChart = (isLoading, dashboardData) => {
if (isLoading !== true) {
if (dashboardData.data.project_utilization.dataAvailable) {
const chartData = [];
let count = 0;
- Create a ticketCreate a ticket
Function getCPUChart
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getCPUChart = (isLoading, dashboardData) => {
if (isLoading !== true) {
if (dashboardData.data.project_utilization.dataAvailable) {
const chartData = [];
let count = 0;
- Create a ticketCreate a ticket
Method build_schedule_options_for_select
has 74 lines of code (exceeds 25 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"],
- Create a ticketCreate a ticket
Function onSubmit
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (values) => {
// Compares initialValues and values and returns the value only if it's different
const isDifferent = (name) => (get(initialValues, name) !== get(values, name) ? get(values, name) : undefined);
miqSparkleOn();
- Create a ticketCreate a ticket
Method schedule_edit
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def schedule_edit
assert_privileges("schedule_edit")
case params[:button]
when "cancel"
@schedule = MiqSchedule.find_by(:id => params[:id])
- Create a ticketCreate a ticket