Showing 923 of 941 total issues
Function HonorCertificate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function HonorCertificate({ young, cohort }) {
let cniExpired = false;
if (young && young.cohort && young.latestCNIFileExpirationDate) {
const cohortStartingDate = cohort?.dateStart;
if (cohortStartingDate) {
- 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 Line
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Line = ({ hit, onClick, opened, onSelect, selected }) => {
const [value, setValue] = useState(null);
const [modalPointageFicheSanitaire, setModalPointageFicheSanitaire] = useState({ isOpen: false });
useEffect(() => {
- 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 Forgot
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function Forgot() {
const [done, setDone] = React.useState(false);
const [email, setEmail] = React.useState("");
const [loading, setLoading] = React.useState(false);
const [disabled, setDisabled] = React.useState(true);
- 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 MissionsComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function MissionsComponent() {
const young = useSelector((state) => state.Auth.young);
const [filters, setFilters] = React.useState({
search: "",
location: {
- 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 AccountSpecialSituationsPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const AccountSpecialSituationsPage = () => {
const young = useSelector((state) => state.Auth.young);
const values = {
handicap: (young.handicap || "false") === "true" ? true : 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 View
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function View() {
const { young } = useAuth();
const phase2NumberHoursDone = young.phase2NumberHoursDone || 0;
const applications = useQuery({ queryKey: ["application"], queryFn: () => fetchApplications(young._id) });
const equivalences = useQuery({ queryKey: ["equivalence"], queryFn: () => fetchEquivalences(young._id) });
- 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 exploreDir
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function exploreDir(basedir, dir, relativeDir) {
const uniqueId = getNextUniqueId();
let context = {
title: dir,
folders: [],
- 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 AddressDisplay
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function AddressDisplay({ data, updateData, error, correction }) {
const userIsInInscription = window.location.pathname.includes("inscription");
const { isCLE } = useAuth();
function handleClick() {
- 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 ModalPointageDepart
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function ModalPointageDepart({ isOpen, onSubmit, onCancel, young }) {
const [isLoading, setIsLoading] = React.useState(false);
const [departSejourMotif, setDepartSejourMotif] = React.useState("");
const [departSejourAt, setDepartSejourAt] = React.useState("");
const [departSejourMotifComment, setDepartSejourMotifComment] = React.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 Step
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Step = ({ young: { hasStartedReinscription, reinscriptionStep2023, inscriptionStep2023 } }) => {
const { step } = useParams();
const { isCLE } = useAuth();
const title = isCLE ? "Inscription de l'élève" : "Inscription du volontaire";
const supportLink = `${supportURL}${isCLE ? "/base-de-connaissance/les-classes-engagees" : "/base-de-connaissance/phase-0-les-inscriptions"}`;
- 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 WaitingReinscription
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function WaitingReinscription({ reinscriptionOpen }) {
const young = useSelector((state) => state.Auth.young);
const history = useHistory();
let textPrecision;
- 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 missingElementsByCohortDepartment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
service.missingElementsByCohortDepartment = (response, departmentsCohortsFromRepartition, cohorts) => {
const data = [];
for (const cohort of cohorts) {
const cohortDepartments = departmentsCohortsFromRepartition.filter((e) => e.cohort === cohort).map((e) => e.fromDepartment);
// Chaque département doit avoir un contact pour la cohorte
- 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 WaitingValidation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function WaitingValidation() {
const { young, isCLE } = useAuth();
const cohort = getCohort(young.cohort);
const history = useHistory();
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 buildStructureContext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function buildStructureContext(user) {
const contextFilters = [];
// A responsible can only see their structure and parent structure (not sure why we need ES though).
if (user.role === ROLES.RESPONSIBLE) {
- 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 buildClasseContext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function buildClasseContext(user) {
const contextFilters = [];
if (await isFeatureAvailable(FeatureFlagName.CLE_BEFORE_JULY_15)) {
if (user.role !== ROLES.ADMIN) {
contextFilters.push({ term: { "schoolYear.keyword": "2023-2024" } });
- 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 InfoStructure
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const InfoStructure = ({ title, structure }) => {
const [value, setValue] = useState();
const [expandNote, setExpandNote] = useState(false);
useEffect(() => {
(async () => {
- 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 InfoStructure
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const InfoStructure = ({ title, structure }) => {
const [value, setValue] = useState();
const [expandNote, setExpandNote] = useState(false);
useEffect(() => {
(async () => {
- 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 FeedbackComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function FeedbackComponent({ item }) {
const [feedback, setFeedback] = useState({ ...defaultFeedback });
const [hasSubmitted, setSubmitted] = useState(false);
const [isSubmitting, setSubmitting] = 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 render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function render(doc, young) {
let _y;
const hasParent2 = young.parent2Status !== undefined && young.parent2Status !== null && young.parent2Status.trim().length > 0;
const allow = young.parent1AllowImageRights === "true" && (!hasParent2 || young.parent2AllowImageRights === "true");
- 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 initPlanTransport
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function initPlanTransport(planTransport) {
const ids = planTransport.lines.reduce(
(acc, line) => {
const { "ID CENTRE": centreId, "ID PDR 1": pdr1Id, "ID PDR 2": pdr2Id, "ID PDR 3": pdr3Id } = line;
if (centreId) acc.centreIds[centreId] = centreId;
- 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"