Showing 730 of 941 total issues
File material-icons.js
has 3657 lines of code (exceeds 700 allowed). Consider refactoring. Open
export const list = [
"abc",
"ac_unit",
"access_alarm",
"access_alarms",
Function up
has 1827 lines of code (exceeds 200 allowed). Consider refactoring. Open
async up(db, client) {
const youngIds = [
"5ff4c48891eee307c6e53374",
"601489d9f8309807d83fe6ed",
"60193ccf25755907d83f85fe",
Function validatePdtFile
has a Cognitive Complexity of 220 (exceeds 5 allowed). Consider refactoring. Open
export const validatePdtFile = async (
filePath: string,
cohortName: string,
isCle: boolean,
): Promise<{
- 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
File young.ts
has 1952 lines of code (exceeds 700 allowed). Consider refactoring. Open
import mongoose, { Schema, InferSchemaType } from "mongoose";
import { YOUNG_SOURCE_LIST, YOUNG_SOURCE } from "../constants/constants";
import { PHONE_ZONES_NAMES_ARR } from "../phone-number";
import { ROLES_LIST } from "../roles";
Function Index
has 914 lines of code (exceeds 200 allowed). Consider refactoring. Open
export default function Index() {
const [context, setContext] = useState(null);
const history = useHistory();
const token = new URLSearchParams(window.location.search).get("token");
File 20240919125411-young-add-missing-inprogress-status.js
has 1836 lines of code (exceeds 700 allowed). Consider refactoring. Open
const { addSeconds } = require("date-fns");
const { YoungModel } = require("../src/models");
const { logger } = require("../src/logger");
const { YOUNG_STATUS } = require("snu-lib");
Function Settings
has 906 lines of code (exceeds 200 allowed). Consider refactoring. Open
export default function Settings() {
const { user } = useSelector((state) => state.Auth);
const urlParams = new URLSearchParams(window.location.search);
Function AssetsPresentationPage
has 729 lines of code (exceeds 200 allowed). Consider refactoring. Open
export default function AssetsPresentationPage() {
const [filter, setFilter] = useState("");
useEffect(() => {
const filterText = filter && filter.trim().length > 0 ? filter.trim().toLowerCase() : "";
if (filterText && filterText.length > 0) {
File Contract.jsx
has 1500 lines of code (exceeds 700 allowed). Consider refactoring. Open
import Img from "../assets/logo-snu.png";
import React, { useEffect, useState } from "react";
import { Row } from "reactstrap";
import styled from "styled-components";
import { Formik, Field } from "formik";
Function Create
has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring. Open
export default function Create() {
const history = useHistory();
const location = useLocation();
const [selectedRepresentant, setSelectedRepresentant] = useState(1);
const [loading, setLoading] = useState(false);
- 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 StepCoordonnees
has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring. Open
export default function StepCoordonnees() {
const [wasBornInFrance, setWasBornInFrance] = useState("true");
const [data, setData] = useState(defaultState);
const [errors, setErrors] = useState({});
const [corrections, setCorrections] = 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 DetailsView
has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring. Open
export default function DetailsView({ mission, setMission, getMission }) {
const [values, setValues] = useState(mission);
const [editing, setEditing] = useState(false);
const [loading, setLoading] = useState(false);
const [errors, setErrors] = 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 ImageRightsForm
has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring. Open
function ImageRightsForm({ young, token, parentId }) {
const history = useHistory();
const [errors, setErrors] = useState({});
const [saving, setSaving] = React.useState(false);
const address = getInitialAdress(young, parentId);
- 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
File referentController.ts
has 1415 lines of code (exceeds 700 allowed). Consider refactoring. Open
import express, { Response } from "express";
import { logger } from "../logger";
import passport from "passport";
import crypto from "crypto";
import jwt from "jsonwebtoken";
Function StepCoordonnees
has 652 lines of code (exceeds 200 allowed). Consider refactoring. Open
export default function StepCoordonnees() {
const [wasBornInFrance, setWasBornInFrance] = useState("true");
const [data, setData] = useState(defaultState);
const [errors, setErrors] = useState({});
const [corrections, setCorrections] = useState({});
Function StepRepresentants
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
export default function StepRepresentants() {
const young = useSelector((state) => state.Auth.young);
const history = useHistory();
const parent1Keys = ["parent1Status", "parent1FirstName", "parent1LastName"];
const parent2Keys = ["parent2Status", "parent2FirstName", "parent2LastName"];
- 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 Details
has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring. Open
export default function Details({ user, setUser, currentUser }) {
const [structures, setStructures] = useState([]);
const [sessionOptions, setSessionOptions] = useState([]);
const [sessionsWhereUserIsHeadCenter, setSessionsWhereUserIsHeadCenter] = useState([]);
const [mode, setMode] = useState(MODE_DEFAULT);
- 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 EditEquivalence
has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring. Open
export default function EditEquivalence() {
const young = useSelector((state) => state.Auth.young);
const keyList = ["type", "desc", "structureName", "address", "zip", "city", "startDate", "endDate", "contactFullName", "contactEmail", "files", "missionDuration"];
const [data, setData] = useState();
const [openType, setOpenType] = useState(false);
- 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 SectionParents
has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring. Open
export default function SectionParents({ young, onStartRequest, currentRequest, onCorrectionRequestChange, requests, globalMode, onChange, oldCohort, readonly }) {
const [currentParent, setCurrentParent] = useState(1);
const [hasSpecificSituation, setHasSpecificSituation] = useState(false);
const [sectionMode, setSectionMode] = useState(globalMode);
const [data, setData] = useState(filterDataForYoungSection(young, "parent"));
- 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 Create
has 561 lines of code (exceeds 200 allowed). Consider refactoring. Open
export default function Create(props) {
const structureIdFromParams = props?.match?.params?.id;
const urlParams = new URLSearchParams(window.location.search);
const duplicate = urlParams.get("duplicate");
const [values, setValues] = useState({