Showing 2,015 of 18,390 total issues
Method set_session_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_session_data
session[:vm_lastaction] = @lastaction
session[:vm_showtype] = @showtype
session[:miq_compressed] = @compressed unless @compressed.nil?
session[:miq_exists_mode] = @exists_mode unless @exists_mode.nil?
- 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_session_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_session_data
session[:vm_lastaction] = @lastaction
session[:vm_showtype] = @showtype
session[:miq_compressed] = @compressed unless @compressed.nil?
session[:miq_exists_mode] = @exists_mode unless @exists_mode.nil?
- 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_variables_report_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_variables_report_data(settings, current_view)
settings[:sort_dir] = @sortdir unless settings.nil?
settings[:sort_col] = @sortcol unless settings.nil?
@edit = session[:edit]
@policy_sim = @edit[:policy_sim] unless @edit.nil?
- 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 import
has a Cognitive Complexity of 10 (exceeds 5 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]
- 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_audit_payload_changes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_audit_payload_changes(new, current)
if current
current = current.deep_clone
diff = Vmdb::Settings::HashDiffer.diff(current, new)
Vmdb::Settings.mask_passwords!(current)
- 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 export
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def export
assert_privileges('policy_import_export')
@breadcrumbs = []
@layout = "miq_policy_export"
drop_breadcrumb(:name => _("Import / Export"), :url => "miq_policy_export")
- 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_preview
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def show_preview
assert_privileges(session.fetch_path(:edit, :rpt_id) ? "miq_report_edit" : "miq_report_new")
unless params[:task_id] # First time thru, kick off the report generate task
@rpt = create_report_object # Build a report object from the latest edit 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 condition_build_edit_screen
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def condition_build_edit_screen
@edit = {}
@edit[:new] = {}
@edit[:current] = {}
- 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_config
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_config(db_record)
@cluster_config = []
unless db_record.ha_enabled.nil?
@cluster_config.push(:field => "HA Enabled",
:description => db_record.ha_enabled)
- 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 key
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def key
if @object.try(:id).nil?
# FIXME: this makes problems in tests
# to handle "Unassigned groups" node in automate buttons tree
"-#{@object.name.split('|').last}"
- 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_expression_vars
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_expression_vars
@edit[:new][:expression] = @condition.expression.kind_of?(MiqExpression) ? @condition.expression.exp : nil
@edit[:new][:applies_to_exp] = @condition.applies_to_exp.kind_of?(MiqExpression) ? @condition.applies_to_exp.exp : nil
# Populate exp editor fields for the expression column
- 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 create_custom_menu_section
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_custom_menu_section(properties)
icon = properties.key?('icon') ? properties['icon'] : nil
placement = properties.key?('placement') ? properties['placement'].to_sym : :default
before = properties.key?('before') ? properties['before'].to_sym : nil
section_type = properties.key?('section_type') ? properties['section_type'].to_sym : :default
- 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 load_c3_chart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.load_c3_chart = function(data, chart_id, height) {
if (typeof (data.miqChart) === 'undefined') {
data.miqChart = 'Line';
}
- Create a ticketCreate a ticket
Function recalculateChartYAxisLabels
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.recalculateChartYAxisLabels = function(id) {
// hide/show chart with id
this.api.toggle(id);
var minMax = getMinMaxFromChart(this);
- Create a ticketCreate a ticket
Function setConfigInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setConfigInfo = function(configData) {
var method = {
name: configData.name,
display_name: configData.display_name,
class_id: configData.class_id,
- Create a ticketCreate a ticket
Function miqHttpInject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function miqHttpInject(angular_app) {
angular_app.config(['$locationProvider', function($locationProvider) {
/**
* hashPrefix must be empty othervise it will conflict with HashRouter and create infinite loop
* React HashRouter can be configured to have hashbang prefix,
- Create a ticketCreate a ticket
Function number_with_delimiter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function number_with_delimiter(val, options) {
options = _.extend({ delimiter: ',', separator: '.' }, options || {});
var intpart;
var floatpart;
var minus;
- Create a ticketCreate a ticket
Function convertMultParamsToRailsMultParams
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function convertMultParamsToRailsMultParams(fullParamString) {
const keyValuePairsArr = [];
if (fullParamString) {
fullParamString.split('&').forEach((element) => {
if (element) {
- Create a ticketCreate a ticket
Function setupForm
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const setupForm = (initialValues, resources, name) => {
const modifiedInitialValues = {
name, values: [], enforced: [], invalid: [], ...initialValues,
};
- Create a ticketCreate a ticket
Function loadvalues
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const loadvalues = (values) => {
let stop = false;
if (!allitems && values.selectedItems.length === options.length - 1) {
setAllItems(true);
values.selectedItems.push({ value: 'all', label: 'SELECT ALL' });
- Create a ticketCreate a ticket