Showing 2,015 of 18,390 total issues
Function PerformanceChartWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const PerformanceChartWidget = ({
// eslint-disable-next-line no-unused-vars
data, id, size, title,
}) => {
let convertedData = getLineConvertedData(data);
- 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 textual_availability_zone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def textual_availability_zone
return nil unless @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager::Host)
availability_zone = @record.availability_zone
h = {:label => _('Availability Zone'),
- 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 hide_button
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def hide_button(button, opt)
if opt == "on"
button ? '' : 'display:none'
else
button ? 'display:none' : ''
- 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 TreeViewBase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TreeViewBase = ({
actionMapper: overrideActionMapper,
loadData,
lazyLoadData,
isMulti,
- 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 KebabListItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const KebabListItem = (item, props) => {
if (item.type === 'separator') {
return <SideNavDivider key={item.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 miq_summary_condition_expression
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def miq_summary_condition_expression(expression_table)
rows = []
data = {:title => _('Expression'), :mode => "miq_condition_expression"}
if !expression_table.nil?
expression_table.each do |token|
- 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 TreeViewField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TreeViewField = ({
loadData, lazyLoadData, validateOnMount, helperText, identifier, ...props
}) => {
const {
labelText,
- 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 MenuSearch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MenuSearch = ({
expanded, menu, onSearch, toggle,
}) => {
if (!expanded) {
return (
- 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_reports_menu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_reports_menu(hide_custom = false, group = current_group)
reports = group.try(:settings).try(:[], :report_menus) || default_reports_menu
unless hide_custom
# Select all custom reports
query = {:template_type => 'report', :rpt_type => 'Custom'}
- 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 report_widget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def report_widget(widget_nodes)
data = {:title => _('Widgets'), :mode => "miq_report_widgets bordered-list simple_table", :rows => []}
if widget_nodes.blank?
data[:message] = _("Report doesn't belong to Widgets.")
else
- 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 onViewClick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const onViewClick = (button) => {
if (button.url && (button.url.indexOf('/') === 0)) {
const delimiter = (button.url === '/') ? '' : '/';
const tail = (ManageIQ.record.recordId) ? delimiter + ManageIQ.record.recordId : '';
- 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 dateRangeValidator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const dateRangeValidator = (validatorSchema) => (value, allValues) => {
if (allValues.startDate && allValues.endDate) {
if (allValues.startDate[0] > allValues.endDate[0]) {
return __(`Start Date must come before End Date`);
}
- 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 miq_summary_condition_scope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def miq_summary_condition_scope(applies_to_exp_table)
rows = []
data = {:title => _('Scope'), :mode => "miq_condition_scope"}
if !applies_to_exp_table.nil?
applies_to_exp_table.each do |token|
- 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 common_list_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def common_list_data(details_data)
details_data.each do |record|
next if record.name == '$'
cells = []
- 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 settings_analysis_profile_summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def settings_analysis_profile_summary(selected_scan, categories, files, file_stats, registry, nteventlog)
summary = [settings_analysis_basic_info(selected_scan)]
summary.push(settings_analysis_categories(categories)) if categories && selected_scan.mode != "Host"
summary.push(settings_analysis_files(files, file_stats)) if files
summary.push(settings_analysis_registry_items(registry)) if registry && selected_scan.mode != "Host"
- 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 catalog_tab_configuration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def catalog_tab_configuration(record)
condition = catalog_tab_conditions(record)
tab_labels = [:basic]
tab_labels.push(:detail) if condition[:detail]
- 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 textual_device
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def textual_device
device = @record.device
if device.kind_of?(VmOrTemplate)
instance = @record.device
h = 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 disabled?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def disabled?
super
@error_message ||= _("Unable to refresh the provider while it is suspended") unless @record.enabled?
@error_message ||= _("Credentials must be valid to refresh a provider") unless @record.authentication_status.downcase == "valid"
@error_message.present?
- 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 catalog_tab_conditions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def catalog_tab_conditions(record)
{
:detail => record.display && !record.prov_type.try(:start_with?, "generic_"),
:resource => record.composite?,
:request => !record.prov_type || (record.prov_type && need_prov_dialogs?(record.prov_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
Method disabled?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def disabled?
@error_message = if @record.class == AssignedServerRole
if @record.active
_("This Role is already active on this Server")
elsif !@record.miq_server.started?
- 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"