Showing 109 of 381 total issues
Function EditRoleModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const EditRoleModal = ({ cancelRoute, submitRoute = cancelRoute, afterSubmit }) => {
const intl = useIntl();
const isMounted = useIsMounted();
const navigate = useAppNavigate();
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 createRows
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const createRows = (showResDefinitions, uuid, data, intl, selectedRows = []) =>
data.reduce((acc, { resourceDefinitions, permission, modified }) => {
const [appName, type, operation] = permission.split(':');
return [
...acc,
- 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 RbacBreadcrumbs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const RbacBreadcrumbs = (breadcrumbs) => {
return breadcrumbs ? (
<Breadcrumb>
{Object.values(breadcrumbs).map((item, index) =>
item.title ? (
- 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 RolesList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const RolesList = ({ selectedRoles, setSelectedRoles, rolesExcluded, groupId: groupUuid }) => {
const intl = useIntl();
const chrome = useChrome();
const dispatch = useDispatch();
const textFilterRef = useRef(null);
- 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 MUAAccessTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MUAAccessTable = ({ filters, setFilters, apps, hasActiveFilters, showResourceDefinitions }) => {
const intl = useIntl();
const [{ rdOpen, rdPermission, resourceDefinitions }, setRdConfig] = useState({ rdOpen: false });
const { current: columns } = useRef([
{ title: intl.formatMessage(messages.application), key: 'application', transforms: [sortable] },
- 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 MyUserAccess
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MyUserAccess = () => {
const intl = useIntl();
const chrome = useChrome();
const [user, setUser] = useState({});
const [{ bundle }, setSearchParams] = useSearchParams();
- 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 isExternalIdp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const isExternalIdp = (token = '') => {
let roles = [''];
let tokenArray = token.split('.');
if (tokenArray.length > 1) {
let token1 = window.atob(tokenArray[1]);
- 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 validateNextAddRolePermissionStep
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateNextAddRolePermissionStep = (currentStep, values) => {
const permissions = (values && values['add-permissions-table']) || [];
const hasCostPermissions = permissions.some(({ uuid }) => isCostPermission(uuid));
const hasInventoryPermissions = permissions.some(({ uuid }) => isInventoryPermission(uuid));
- 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 AddGroupWizard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AddGroupWizard = ({ postMethod, pagination, filters, orderBy }) => {
const dispatch = useDispatch();
const intl = useIntl();
const container = useRef(document.createElement('div'));
const { isBeta } = useChrome();
- 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"