Function UpdateProfileForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
function UpdateProfileForm({ initialValues }) {
const [shouldShowMilitaryStep, handleShouldShowMilitaryStep] = useState(false);
const generateError = errorObject => {
Function getPagination
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
const getPagination = (
currentPage: PaginationPropsType['currentPage'],
totalPages: PaginationPropsType['totalPages'],
) => {
Function Pagination
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
function Pagination({ currentPage, pathname, query, totalPages }: PaginationPropsType) {
if (process.env.NODE_ENV !== 'production') {
const isCurrentPageTooSmall = currentPage < 1;
Function NavListItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
function NavListItem({ sublinks, href, name, icon = null }: NavListItemPropsType) {
const [areSublinksVisible, setSublinksVisible] = useState(false);
const handleKeyDown = (event: React.KeyboardEvent, indexKeyedOn: number) => {
const lastSublinkIndex = sublinks && sublinks.length - 1;
Function MultiStepForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
export function MultiStepForm({
steps,
initialValues,
onEachStepSubmit,
onFinalSubmit,
Function mockPassword
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
export default function mockPassword({
hasMinimumLength = true,
hasOneLowercaseChar = true,
hasOneUppercaseChar = true,
hasOneNumber = true,
Function RegistrationForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
function RegistrationForm({ initialValues, onSubmit, onSuccess }) {
const [errorMessage, setErrorMessage] = useState('');
const handleSubmit = async (values, actions) => {
try {