Showing 2,015 of 18,390 total issues
Method db_get_form_vars
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def db_get_form_vars
@in_a_form = true
@dashboard = @edit[:db_id] ? MiqWidgetSet.find(@edit[:db_id]) : MiqWidgetSet.new
if %w[up down].include?(params[:button])
db_move_cols_up if params[:button] == "up"
- 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 alert_build_pulldowns
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def alert_build_pulldowns
@sb[:alert] ||= {}
# :event_types
unless @sb[:alert][:events] # Only create this once
- 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 validate_user
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def validate_user(user, task_id = nil, request = nil, authenticate_options = {})
if task_id.present?
validate_user_collect_task(user, task_id)
else # First time thru, kick off authenticate task
validation = validate_user_kick_off_task(user, request, authenticate_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 heatmaps_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def heatmaps_data(metrics)
node_cpu_usage = []
node_memory_usage = []
metrics.each do |m|
- 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 getConfigInfo
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getConfigInfo = function(configData) {
vm.catalogItemModel.provisioning_repository_id = configData.provision.repository_id;
vm.catalogItemModel.provisioning_playbook_id = configData.provision.playbook_id;
vm.catalogItemModel.provisioning_machine_credential_id = configData.provision.credential_id;
vm.catalogItemModel.provisioning_network_credential_id = configData.provision.network_credential_id;
- Create a ticketCreate a ticket
Method workflow_instance_from_vars
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def workflow_instance_from_vars(req)
options = {}
pre_prov_values = nil
if %w[miq_template service_template vm].include?(@edit[:org_controller])
if params[:prov_type] && !req # only do this new requests
- Create a ticketCreate a ticket
Method gfv_key_style
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gfv_key_style(key, value)
parm, f_idx, s_idx = key.split("_") # Get the parm type, field index, and style index
f_idx = f_idx.to_i
s_idx = s_idx.to_i
f = @edit[:new][:field_order][f_idx] # Get the field element
- Create a ticketCreate a ticket
Function containerNodesData
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const containerNodesData = () => {
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 perf_chart_chooser
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perf_chart_chooser
assert_privileges("perf_reload")
@record = identify_tl_or_perf_record
@perf_record = @record.kind_of?(MiqServer) ? @record.vm : @record # Use related server vm record
- Create a ticketCreate a ticket
Method settings_replace_right_cell
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings_replace_right_cell(nodetype, presenter)
case nodetype
when "ze" # zone edit
# when editing zone in settings tree
if @zone.id.blank?
- Create a ticketCreate a ticket
Method gfv_sort
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gfv_sort
@edit[:new][:order] = params[:sort_order] if params[:sort_order]
if params[:sort_group] # If grouping changed,
@edit[:new][:group] = params[:sort_group]
@refresh_div = "sort_div" # Resend the sort tab
- Create a ticketCreate a ticket
File miq-component.spec.js
has 414 lines of code (exceeds 400 allowed). Consider refactoring. Open
import {
getDefinition,
sanitizeAndFreezeInstanceId,
validateInstance,
define,
- Create a ticketCreate a ticket
Class MiqActionController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqActionController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
- Create a ticketCreate a ticket
Class AnsibleRepositoryController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class AnsibleRepositoryController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
- Create a ticketCreate a ticket
Method display_methods
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def display_methods
%w[
availability_zones
cloud_databases
cloud_networks
- Create a ticketCreate a ticket
Method authenticate
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def authenticate
@layout = "dashboard"
unless params[:task_id] # First time thru, check for buttons pressed
# Handle More and Back buttons (for changing password)
- Create a ticketCreate a ticket
Method miq_report_edit
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_report_edit
assert_privileges(params[:id] || (@edit && @edit[:rpt_id]) ? "miq_report_edit" : "miq_report_new")
case params[:button]
when "cancel"
if @edit[:rpt_id]
- Create a ticketCreate a ticket
Method schedule_edit
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def schedule_edit
assert_privileges("miq_report_schedule_edit")
case params[:button]
when "cancel"
@schedule = MiqSchedule.find(session[:edit][:sched_id]) if session[:edit] && session[:edit][:sched_id]
- Create a ticketCreate a ticket
Function link
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, _elem, attrs, ctrl) {
scope.$watch(attrs.ngModel, function() {
if (ctrl.viewValue !== undefined) {
setSomePeriodCheckedValidity(ctrl, attrs);
}
- Create a ticketCreate a ticket
Function createSchema
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (newRecord, showUseConfig, ancestry, itemId) => {
let fields = [{
component: componentTypes.TEXT_FIELD,
id: 'name',
name: 'name',
- Create a ticketCreate a ticket