Function useAxios
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
function useAxios() {
const { authToken, logout } = useAuth();
const handleResponse = (
resp: AxiosResponse,
Function LoginForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
export function LoginForm(props: PaperProps) {
const [type, toggle] = useToggle(["login", "register"]);
const { uploadData, submitting, success, data } = usePost();
const { login } = useAuth();
const navigate = useNavigate();
Consider simplifying this complex logical expression.
if (
props?.required &&
(form[field_name] === undefined ||
form[field_name] === null ||
form[field_name] === "") &&
Function CreateProjectForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
const CreateProjectForm = (props: TCreateProjectForm) => {
const {
project,
showTitle = true,
onCancel = false,
Function usePost
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
const usePost = () => {
const [submitting, setSubmitting] = useState(false);
const [error, setError] = useState<TError>({});
const [success, setSuccess] = useState(false);
const [data, setData] = useState<any>();
Function DatabaseDetails
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
const DatabaseDetails = () => {
const [deleteConfirmOpened, setDeleteConfirmOpened] = useState(false);
const [disableConfirmOpened, setDisableConfirmOpened] = useState(false);
const [enableConfirmOpened, setEnableConfirmOpened] = useState(false);
const [resetConfirmOpened, setResetConfirmOpened] = useState(false);
Function ProjectsList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
const ProjectsList = () => {
const { data: projectsData, getData, loading, success } = useGet();
const [projects, setProjects] = useState<any[]>([]);
const [viewMode, toggleViewMode] = useToggle<"grid" | "list">([
"grid",
Function CreateDatabaseForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
const CreateDatabaseForm = (props: any) => {
const { showTitle = true, database, project_id, onCancel, refresh } = props;
const { form, updateFormValue, editedForm } = useForm();
const {
uploadData,
Function LeftMenu
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
const LeftMenu = React.memo(({
menuType,
projectId,
title,
subtitle,
Function CICDTab
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
const CICDTab = ({
app,
setRefresh,
}: {
app: any;
Function useForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
const useForm = () => {
const [form, setForm] = useState<TForm>({});
const [editedForm, setEditedForm] = useState<any>({});
const updateFormValue = (key: string, value: TFormUpdateValue) => {
setForm({
Function AppDetailPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
const AppDetailPage = () => {
const { app_id } = useParams();
const { app, loading } = useGetApp(app_id || "");
useSetContainerSize("md");
Function EnvironmentVariablesTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
export const EnvironmentVariablesTable = ({
envVariables,
}: {
envVariables: EnvVariable[];
}) => {