Showing 109 of 381 total issues
File Messages.js
has 2210 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { defineMessages } from 'react-intl';
export default defineMessages({
inviteUsers: {
id: 'inviteUsers',
Function User
has 285 lines of code (exceeds 25 allowed). Consider refactoring. Open
const User = () => {
const intl = useIntl();
const navigate = useAppNavigate();
const navigationType = useNavigationType();
const dispatch = useDispatch();
Function Permissions
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
const Permissions = ({ cantAddPermissions, isLoading }) => {
const intl = useIntl();
const { role, isRecordLoading } = useSelector(
(state) => ({
role: state.roleReducer.selectedRole,
- 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 Group
has 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Group = () => {
const intl = useIntl();
const dispatch = useDispatch();
const navigate = useAppNavigate();
const location = useLocation();
Function Groups
has 234 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Groups = () => {
const intl = useIntl();
const dispatch = useDispatch();
const navigate = useNavigate();
const location = useLocation();
Function WorkspacesOverview
has 233 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WorkspacesOverview = () => {
const [isExpanded, setIsExpanded] = React.useState(false);
const intl = useIntl();
const navigate = useNavigate();
Function Roles
has 232 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Roles = () => {
const { orgAdmin, userAccessAdministrator } = useContext(PermissionsContext);
const [selectedRows, setSelectedRows] = useState([]);
const intl = useIntl();
const dispatch = useDispatch();
Function Overview
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Overview = () => {
const intl = useIntl();
const [expanded, setExpanded] = useState(true);
const isWorkspacesFlag = useFlag('platform.rbac.workspaces');
const isWorkspacesEligible = useFlag('platform.rbac.workspaces-eligible');
File users-list-itless.js
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, Fragment, useState, useContext, useRef, useCallback, Suspense } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import truncate from 'lodash/truncate';
import { useIntl } from 'react-intl';
import PropTypes from 'prop-types';
Function Role
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
const Role = ({ onDelete }) => {
const intl = useIntl();
const chrome = useChrome();
const navigate = useAppNavigate();
const navigationType = useNavigationType();
- 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 schemaBuilder
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const schemaBuilder = (container, featureFlag) => {
const cache = createIntlCache();
const intl = createIntl({ locale, messages: providerMessages }, cache);
return {
Function InventoryGroupsRole
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InventoryGroupsRole = (props) => {
const intl = useIntl();
const dispatch = useDispatch();
const { input } = useFieldApi(props);
const formOptions = useFormApi();
Function User
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
const User = () => {
const intl = useIntl();
const navigate = useAppNavigate();
const navigationType = useNavigationType();
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"
Further reading
Function GroupMembers
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GroupMembers = () => {
const intl = useIntl();
const chrome = useChrome();
const [filterValue, setFilterValue] = useState('');
const [selectedMembers, setSelectedMembers] = useState([]);
Function GroupServiceAccounts
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GroupServiceAccounts = () => {
const intl = useIntl();
const dispatch = useDispatch();
const navigate = useAppNavigate();
const { groupId } = useParams();
Function createRows
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createRows = (isAdmin, data, selectedRows, expanded = []) => {
const intl = useIntl();
const compoundRolesCells = [
{ title: intl.formatMessage(messages.roleName) },
Function UsersListItless
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
const UsersListItless = ({ 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"
Further reading
Function GroupRoles
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const GroupRoles = ({ onDefaultGroupChanged }) => {
const intl = useIntl();
const chrome = useChrome();
const dispatch = useDispatch();
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 ResourceDefinitions
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResourceDefinitions = () => {
const intl = useIntl();
const [config, setConfig] = useState({
pagination: {
...defaultSettings,
Function AddPermissionsTable
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
const AddPermissionsTable = ({ selectedPermissions, setSelectedPermissions, ...props }) => {
const [isOrgAdmin, setIsOrgAdmin] = useState(null);
const { auth } = useChrome();
const dispatch = useDispatch();
const intl = useIntl();
- 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"