Showing 109 of 381 total issues
Function Roles
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const Roles = () => {
const { orgAdmin, userAccessAdministrator } = useContext(PermissionsContext);
const [selectedRows, setSelectedRows] = useState([]);
const intl = useIntl();
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 reducer
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer = (state, action) => {
const prevState = state[action.key];
switch (action.type) {
case 'toggle':
return {
Function GroupMembers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const GroupMembers = () => {
const intl = useIntl();
const chrome = useChrome();
const [filterValue, setFilterValue] = useState('');
const [selectedMembers, setSelectedMembers] = useState([]);
- 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 GroupServiceAccounts
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const GroupServiceAccounts = () => {
const intl = useIntl();
const dispatch = useDispatch();
const navigate = useAppNavigate();
const { groupId } = useParams();
- 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 UsersListNotSelectable
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const UsersListNotSelectable = ({ userLinks, usesMetaInURL, props }: UsersListNotSelectableI) => {
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 onSubmit
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (formData) => {
const {
'role-name': name,
'role-description': description,
'role-copy-name': copyName,
Function onSubmit
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = async (formData) => {
const {
'add-permissions-table': selectedPermissions,
'cost-resources': costResources = [],
'inventory-groups-role': invResources = [],
Function filterConfigBuilder
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const filterConfigBuilder = (
isLoading,
setFilterValue = () => undefined,
fetchData = () => undefined,
filterValue = '',
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const ResourceDefinitions = () => {
const intl = useIntl();
const [config, setConfig] = useState({
pagination: {
...defaultSettings,
- 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 AddGroupMembers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const AddGroupMembers = ({ cancelRoute }) => {
const chrome = useChrome();
const intl = useIntl();
const navigate = useAppNavigate();
const { groupId } = useParams();
- 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 UserGroupsTable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const UserGroupsTable: React.FunctionComponent<UserGroupsTableProps> = ({
defaultPerPage = 20,
useUrlParams = true,
enableActions = true,
ouiaId = 'iam-user-groups-table',
- 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 QuickstartsTestButtons
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const QuickstartsTestButtons = () => {
const intl = useIntl();
const [openQuickstart, setOpenQuickstart] = useState(false);
const chromeHook = useChrome();
const navigate = useNavigate();
Function SetUsers
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SetUsers = (props) => {
const [selectedUsers, setSelectedUsers] = useState([]);
const { input } = useFieldApi(props);
const intl = useIntl();
const formOptions = useFormApi();
Function UsersTable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const UsersTable: React.FunctionComponent<UsersTableProps> = ({ onAddUserClick }) => {
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
const [currentUser, setCurrentUser] = useState<User | undefined>();
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"
Further reading
Function EditGroupModal
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const EditGroupModal = ({ postMethod, pagination, cancelRoute, submitRoute = cancelRoute, group, onClose }) => {
const intl = useIntl();
const [selectedGroup, setSelectedGroup] = useState(undefined);
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 listPermissions
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
limit,
offset,
orderBy,
application,
resourceType,
Function syncDefaultFiltersWithUrl
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const syncDefaultFiltersWithUrl = (location, navigate, keys, defaults = {}) => {
const searchParams = new URLSearchParams(location.search);
let filters = keys.reduce((acc, key) => {
const values = searchParams.getAll(key);
Function toolbarDropdowns
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const toolbarDropdowns = () => {
const onToggle = (isOpen) => {
setIsToolbarDropdownOpen(isOpen);
};
const onToolbarDropdownSelect = async (_event) => {
Function Routing
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Routing = () => {
const location = useLocation();
const { updateDocumentTitle, isBeta } = useChrome();
const isITLess = useFlag('platform.rbac.itless');
const enableServiceAccounts =
Function TypeSelector
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TypeSelector = (props) => {
const intl = useIntl();
const { input } = useFieldApi(props);
const formOptions = useFormApi();
const [checked, setChecked] = useState(formOptions.getState().values['role-type']);