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 Index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function Index() {
const young = useSelector((state) => state.Auth.young);
const { isCLE } = useAuth();
const cohort = getCohort(young.cohort);
- 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 renderStep
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function renderStep(step) {
if (step === STEPS.COORDONNEES) return <StepCoordonnees />;
if (step === STEPS.REPRESENTANTS) return <StepRepresentants />;
if (step === STEPS.CONSENTEMENTS) return <StepConsentements />;
if (step === STEPS.DOCUMENTS) return <StepDocuments />;
- 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 renderStepCorrection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function renderStepCorrection(step) {
if (step === CORRECTION_STEPS.ELIGIBILITE) return <MobileCorrectionEligibilite />;
if (step === CORRECTION_STEPS.PROFIL) return <MobileCorrectionProfil />;
if (step === CORRECTION_STEPS.COORDONNEES) return <StepCoordonnees />;
if (step === CORRECTION_STEPS.REPRESENTANTS) return <StepRepresentants />;
- 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"