Showing 2,015 of 18,390 total issues
Function CloudDatabaseForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CloudDatabaseForm = ({ recordId }) => {
const [{
isLoading, initialValues, fields,
}, setState] = useState({
isLoading: !!recordId, initialValues: {}, 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 javascript_flash
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def javascript_flash(**args)
add_flash(args[:text], args[:severity]) if args[:text].present?
flash_div_id = args.key?(:flash_div_id) ? args[:flash_div_id] : 'flash_msg_div'
ex = ExplorerPresenter.flash.replace(flash_div_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
Function CloudTenantForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CloudTenantForm = ({ recordId }) => {
const [{ isLoading, initialValues, emsId }, setState] = useState({ isLoading: !!recordId, initialValues: {} });
useEffect(() => {
if (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 WorkflowPayload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const WorkflowPayload = ({ recordId }) => {
const tabLabels = [
{ name: 'text', text: __('Text') },
{ name: 'graph', text: __('Graph') },
];
- 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 CustomURLTabs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CustomURLTabs = ({
tabs, path, currentTab, checkForChanges,
}) => {
const [{ selectedTab, showConfirm, url }, setState] = useState({ selectedTab: 0, showConfirm: false });
const activeTabClassName = 'bx--tabs--scrollable__nav-item--selected';
- 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 WorkflowCredentialsForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const WorkflowCredentialsForm = ({ recordId }) => {
const [{ fields, initialValues, isLoading }, setState] = useState({ fields: [], isLoading: !!recordId });
const promise = useMemo(() => API.options('/api/authentications'), []);
const submitLabel = !!recordId ? __('Save') : __('Add');
- 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 MiqStructuredListLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const MiqStructuredListLink = ({ row, clickEvents, onClick }) => {
const content = <MiqStructuredListContent row={row} />;
/** Function to include content for mode that contains miq summary
* if only link is passed as props we render Link with href tag
- 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 MiqButton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function MiqButton(props) {
let { title } = props;
if (props.enabled && props.enabledTitle) {
title = props.enabledTitle;
}
- 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 isVisibleButtonOrSelect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const isVisibleButtonOrSelect = (item) => (
item.type && (
(isButtonSelect(item) && isButtonSelectVisible(item))
|| (isButton(item) && !item.hidden)
|| (isButtonTwoState(item) && !item.hidden)
- 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 NamespaceSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const NamespaceSelector = ({ onSelectMethod, selectedIds }) => {
const [filterData, setFilterData] = useState({ searchText: '', selectedDomain: '' });
/** Loads the domains and stores in domainData for 60 seconds. */
const { data: domainsData, isLoading: domainsLoading } = useQuery(
- 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 single_relationship_link
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def single_relationship_link(record, table_name, property_name = nil)
property_name ||= table_name
ent = record.send(property_name)
name = ui_lookup(:table => 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
Function MiqStructuredList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const MiqStructuredList = ({
title, headers, rows, mode, onClick, message, className = '',
}) => {
const clickEvents = hasClickEvents(mode);
- 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 request_details_summary
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def request_details_summary(miq_request, user)
rows = [
row_data(_('Request ID'), miq_request.id),
row_data(_('Status'), _(miq_request.status)),
row_data(_('Request State'), _(miq_request.state.titleize))
- 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 MiqStructuredListBody
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const MiqStructuredListBody = ({
rows, mode, onClick, clickEvents,
}) => {
const list = (clickEvents ? rows.map((item) => item.cells) : rows);
- 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 onSubmitData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const onSubmitData = (values, miqRequestInitialOptions) => {
// Request Date (created_recently)
if (values.selectedPeriod) { // user selected
daysAgo = values.selectedPeriod;
} else if (miqRequestInitialOptions.timePeriods[1] && miqRequestInitialOptions.timePeriods[1].value) {
- 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 subscribeToSubject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const subscribeToSubject = (dispatch) => (
listenToRx(
(event) => {
if (event.eventType === 'updateToolbarCount') {
dispatch({ type: 'SET', count: event.countSelected });
- 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 layout_uses_tabs?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def layout_uses_tabs?
return false if %w[login authenticate auth_error].include?(controller.action_name)
layout = case @layout
when 'container_dashboard', 'dashboard', 'ems_infra_dashboard', 'exception', 'physical_infra_overview'
- 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 relationship_table_screen?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def relationship_table_screen?
return false if @display.nil?
display_class = @display.camelize.singularize
return false unless custom_button_appliable_class?(display_class)
# Don't render custom buttons on nested generic object lists since it could contain generic objects with different definitions and custom buttons
- 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 method_missing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(mthd_sym, *args, &bolck)
match = /textual_(.*)/.match(mthd_sym)
if match && match.size > 1
prop = match[1]
value = @record[prop] if @record.attribute_present?(prop)
- 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_parent_service
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def textual_parent_service
parent = @record.parent_service
if parent
{
:label => _("Parent Service"),
- 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"