Showing 109 of 381 total issues
Function createITLessRows
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createITLessRows = (userLinks, data, checkedRows = []) => {
const maxLength = 25;
return data
? data.reduce(
(
Function renderTable
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderTable = () => {
const orderBy = `${sortBy?.direction === 'desc' ? '-' : ''}${columns[sortBy?.index]?.key}`;
return (
<Fragment>
<Toolbar
Function ReviewTemplate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const ReviewTemplate = ({ formFields }) => {
const intl = useIntl();
const navigate = useAppNavigate();
const { submittingGroup, submittingServiceAccounts, error, setWizardError } = useContext(AddGroupWizardContext);
const { getState } = useFormApi();
- Read upRead up
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
File group-actions.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as ActionTypes from '../action-types';
import * as GroupHelper from '../../helpers/group/group-helper';
import { createIntl, createIntlCache } from 'react-intl';
import { BAD_UUID } from '../../helpers/shared/helpers';
import messages from '../../Messages';
Function SetName
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SetName = (props) => {
const intl = useIntl();
const { input } = useFieldApi(props);
const formOptions = useFormApi();
const { 'role-name': name, 'role-description': description } = formOptions.getState().values;
Function SetName
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SetName = (props) => {
const intl = useIntl();
const { input } = useFieldApi(props);
const formOptions = useFormApi();
const { 'group-name': name, 'group-description': description } = formOptions.getState().values;
File Routing.tsx
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Navigate, Route as RouterRoute, Routes as RouterRoutes, matchPath, useLocation } from 'react-router-dom';
import React, { lazy, Suspense, useEffect, useMemo } from 'react';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import { AppPlaceholder } from './presentational-components/shared/loader-placeholders';
import pathnames from './utilities/pathnames';
Function UsersAndUserGroups
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UsersAndUserGroups: React.FunctionComponent = () => {
const intl = useIntl();
const [activeTabKey, setActiveTabKey] = React.useState<number>(0);
const [isAddUserGroupModalOpen, setIsAddUserGroupModalOpen] = React.useState<boolean>(false);
const [selectedUsers, setSelectedUsers] = React.useState<any[]>([]);
Function MyUserAccess
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MyUserAccess = () => {
const intl = useIntl();
const chrome = useChrome();
const [user, setUser] = useState({});
const [{ bundle }, setSearchParams] = useSearchParams();
Function Workspaces
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Workspaces = () => {
const intl = useIntl();
const dispatch = useDispatch();
const selection = useDataViewSelection({ matchOption: (a, b) => a.id === b.id });
Function AddRolePermissionSummaryContent
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AddRolePermissionSummaryContent = () => {
const intl = useIntl();
const formOptions = useFormApi();
const {
'role-name': name,
Function Groups
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const Groups = () => {
const intl = useIntl();
const dispatch = useDispatch();
const navigate = useNavigate();
const location = useLocation();
- Read upRead up
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
File groups.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Suspense, useContext, useEffect, useRef, useCallback, useState } from 'react';
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
import { nowrap, sortable, compoundExpand } from '@patternfly/react-table';
import { Button, Stack, StackItem } from '@patternfly/react-core';
import { useIntl } from 'react-intl';
File about-access-tab.tsx
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { ContentHeader, ServiceCard } from '@patternfly/react-component-groups';
import {
Button,
ButtonVariant,
Function MainTable
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const MainTable = ({
// props for toolbar
columns,
isSelectable,
isLoading,
- Read upRead up
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
File group.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Fragment, useEffect, useState } from 'react';
import useChrome from '@redhat-cloud-services/frontend-components/useChrome';
import { useLocation, useParams, Outlet, useNavigationType } from 'react-router-dom';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { FormattedMessage, useIntl } from 'react-intl';
File overview.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import {
ActionList,
ActionListItem,
Button,
File roles.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect, useContext, useRef, Suspense } from 'react';
import { useIntl } from 'react-intl';
import { shallowEqual, useSelector, useDispatch } from 'react-redux';
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
import { cellWidth, compoundExpand, nowrap, sortable } from '@patternfly/react-table';
Function EditResourceDefinitionsModal
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const EditResourceDefinitionsModal = ({ cancelRoute }) => {
const intl = useIntl();
const { roleId, permissionId } = useParams();
const navigate = useAppNavigate();
- Read upRead up
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 UsersList
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const UsersList = ({ selectedUsers, setSelectedUsers, userLinks, usesMetaInURL, displayNarrow, props }) => {
const intl = useIntl();
const navigate = useNavigate();
const location = useLocation();
const dispatch = useDispatch();
- Read upRead up
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"