Showing 2,015 of 18,390 total issues
Function UtilizationChartGraph
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const UtilizationChartGraph = ({
providerId, title, cpuConfig, memoryConfig, dashboard,
}) => {
const [data, setCardData] = useState({ loading: true });
- 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 getItemIcon
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const getItemIcon = (item) => {
if (item.FinishedTime) {
if (item.Output && item.Output.Error) {
if (item.RetryCount) {
return { icon: 'carbon--RetryFailed' }
- 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 toBytes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const toBytes = (value) => {
if (!value) return undefined;
if (typeof value !== 'number') {
const sizeValue = value.match(/^\d+(\.\d+)*/)[0];
- 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 DataTable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const DataTable = ({
rows,
columns,
inEditMode,
noCheckboxes,
- 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 deleteNetwork
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const deleteNetwork = (row, data, setData, roles) => {
let dataTableData = data.dataTable.networkAdapters || [];
let submitNetworks = data.submitParams.networks.add || [];
let addNetworkIds = data.submitParams.networkIds.add || [];
const deleteNetworksData = data.submitParams.networks.delete || [];
- 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 CustomButtonForm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const CustomButtonForm = ({
recId, url, appliesToClass, appliesToId, customButtonGroupId, distinctInstances, ansiblePlaybooks,
}) => {
const [{
isLoading, initialValues, buttonIcon, roles, serviceDialogs,
- 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 setNetworkFormSubmit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const setNetworkFormSubmit = (data, setData, formData, roles, renderData) => {
if (data.form.action === 'add') {
// code for add function
const id = `network${data.dataTable.networkAdapters.length}`;
const networkData = {
- 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 ToolbarList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const ToolbarList = (props) => {
const count = useContext(CountContext);
const { items, title, id } = props;
// Set this true for overflowmenu keydown event
const [overflowTab, setOverflowTab] = useState(false);
- 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 MiqAeCustomization
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const MiqAeCustomization = ({ dialogRecord, dialogTypes }) => {
const [data, setData] = useState({
isLoading: true,
initialValues: undefined,
});
- 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 PxeServersForm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const PxeServersForm = ({ id }) => {
const [initialValues, setInitialValues] = useState({});
const [isLoading, setIsLoading] = useState(!!id);
useEffect(() => {
- 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 update_from_hash
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_from_hash(params)
%w[typ moths weeks days hours].each do |i|
self[i] = params[:"timer_#{i}"] if params[:"timer_#{i}"]
end
%w[start_hour start_min].each do |i|
- 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_compliance_status
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def textual_compliance_status
h = {:label => _("Status")}
if @record.number_of(:compliances).zero?
h[:value] = _("Never Verified")
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
Method multiple_relationship_link
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def multiple_relationship_link(record, table_name)
return unless role_allows?(:feature => "#{table_name}_show_list")
return if table_name == 'container_route' && !record.respond_to?(:container_routes)
plural = ui_lookup(:tables => table_name.to_s)
- 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 ns_list_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ns_list_data(grid_data)
has_options = User.current_user.super_admin_user?
datastore_options(has_options)
grid_data.each do |record|
next if record.name == '$'
- 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 visible?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def visible?
# TODO: @feature.nil? || @record.nil? || @record.supports?(@feature)
# TODO: ensure start stop are supported in openstack
unless @feature.nil? || @record.nil?
if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager)
- 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 process_resourcepools
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process_resourcepools(rps, task)
rps, _rps_out_region = filter_ids_in_region(rps, "Resource Pool")
return if rps.empty?
if task == "destroy"
- 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_alert_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def miq_summary_alert_info(alert, event, sb_data)
rows = []
data = {:title => _('Info'), :mode => "miq_alert_info", :rows => []}
rows.push({:cells => {:label => _("Description"), :value => alert.description}})
rows.push({:cells => {:label => _("Active"), :value => alert.enabled ? _("Yes") : _("No")}})
- 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_users_basic_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def settings_users_basic_info(record)
rows = [
row_data(_('ID'), record.id),
row_data(_('Full Name'), record.name),
row_data(_('Username'), record.userid),
- 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 disks_attributes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def disks_attributes
disks = []
return disks if @record.hardware.disks.empty?
# HDDs
- 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 process_clusters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process_clusters(clusters, task, _ = nil)
clusters, _clusters_out_region = filter_ids_in_region(clusters, _("Cluster"))
return if clusters.empty?
if task == "destroy"
- 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"