betagouv/service-national-universel

View on GitHub

Comparing main to chore-code-climate

Last commit 914687cb about 15 hours ago
Compare on GitHub

Function reducer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
New

export default function reducer(state = INITIAL_STATE, action) {
  switch (action.type) {
    case authActions.SETUSER:
      // eslint-disable-next-line no-case-declarations
      const previousSigninToken = state.previousSigninToken || sessionStorage.getItem(SS_KEY_PREVIOUS_SIGNIN);
Severity: Minor
Found in admin/src/redux/auth/reducer.ts - About 25 mins to fix

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 getCohortGroups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
New

export const getCohortGroups = (parentFilterKey: string = "cohort"): IIntermediateFilter => {
  return {
    key: parentFilterKey,
    filters: [
      {
Severity: Minor
Found in admin/src/services/cohort.service.ts - About 25 mins to fix

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 exportExcelSheet has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
New

export function exportExcelSheet(etablissements: EtablissementExport[]) {
  const sheetData = etablissements.map((e) => ({
    id: e._id.toString(),
    name: e.name,
    uai: e.uai,
Severity: Minor
Found in admin/src/scenes/etablissement/utils/index.ts - About 2 hrs to fix

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 getRights has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
New

export function getRights(user: User, classe?: Pick<ClasseType, "status" | "schoolYear">, cohort?: CohortDto) {
  if (!user || !classe) return {};
  return {
    canEdit:
      ([ROLES.ADMIN, ROLES.REFERENT_REGION].includes(user.role) && classe?.status !== STATUS_CLASSE.WITHDRAWN) ||
Severity: Minor
Found in admin/src/scenes/classe/utils/index.ts - About 1 hr to fix

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 getFilterArray has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
New

export const getFilterArray = (bus, session, classes) => {
  return [
    {
      title: "Classe Engagée ID",
      name: "classeId",
Severity: Minor
Found in admin/src/scenes/volontaire-cle/utils/list.ts - About 1 hr to fix

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 getFilterArray has 213 lines of code (exceeds 200 allowed). Consider refactoring.
New

export const getFilterArray = (bus, session, classes) => {
  return [
    {
      title: "Classe Engagée ID",
      name: "classeId",
Severity: Major
Found in admin/src/scenes/volontaire-cle/utils/list.ts - About 1 hr to fix

    Function transformVolontairesCLE has 205 lines of code (exceeds 200 allowed). Consider refactoring.
    New

    export async function transformVolontairesCLE(data, values) {
      const all = data;
    
      interface Center {
        _id?: string;
    Severity: Major
    Found in admin/src/scenes/volontaire-cle/utils/list.ts - About 1 hr to fix

      File roles.ts has 982 lines of code (exceeds 700 allowed). Consider refactoring.
      New

      import { ReferentDto, UserDto } from "./dto";
      import { region2department } from "./region-and-departments";
      import { isNowBetweenDates } from "./utils/date";
      import { LIMIT_DATE_ESTIMATED_SEATS, LIMIT_DATE_TOTAL_SEATS, STATUS_CLASSE } from "./constants/constants";
      import { ClasseType, SessionPhase1Type } from "./mongoSchema";
      Severity: Major
      Found in packages/lib/src/roles.ts - About 1 day to fix

        Function canDeleteReferent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        New

        function canDeleteReferent({ actor, originalTarget, structure }) {
          // TODO: we must handle rights more precisely.
          // See: https://trello.com/c/Wv2TrQnQ/383-admin-ajouter-onglet-utilisateurs-pour-les-r%C3%A9f%C3%A9rents
          const isMe = actor._id === originalTarget._id;
        
        
        Severity: Minor
        Found in packages/lib/src/roles.ts - About 25 mins to fix

        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 canUpdateReferent has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        New

        function canUpdateReferent({ actor, originalTarget, modifiedTarget = null, structure }: CanUpdateReferent) {
          const isMe = actor._id?.toString() === originalTarget._id?.toString();
          const isAdmin = actor.role === ROLES.ADMIN;
          const withoutChangingRole = modifiedTarget === null || !("role" in modifiedTarget) || modifiedTarget.role === originalTarget.role;
          const isResponsibleModifyingResponsibleWithoutChangingRole =
        Severity: Minor
        Found in packages/lib/src/roles.ts - About 1 hr to fix

        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 canSigninAs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        New

        const canSigninAs = (actor, target, source) => {
          if (isAdmin(actor)) return true;
          if (!isReferentRegDep(actor)) return false;
        
          if (source === "referent") {
        Severity: Minor
        Found in packages/lib/src/roles.ts - About 1 hr to fix

        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 canAssignManually has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        New

        function canAssignManually(actor, young, cohort) {
          if (!cohort) return false;
          return (
            (actor.role === ROLES.ADMIN && cohort.manualAffectionOpenForAdmin) ||
            (actor.role === ROLES.REFERENT_REGION && actor.region === young.region && cohort.manualAffectionOpenForReferentRegion) ||
        Severity: Minor
        Found in packages/lib/src/roles.ts - About 25 mins to fix

        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 canSearchInElasticSearch has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        New

        function canSearchInElasticSearch(actor, index) {
          if (index === "mission") {
            return [ROLES.ADMIN, ROLES.REFERENT_REGION, ROLES.REFERENT_DEPARTMENT, ROLES.RESPONSIBLE, ROLES.SUPERVISOR].includes(actor.role);
          } else if (index === "school" || index === "schoolramses") {
            return [ROLES.ADMIN, ROLES.REFERENT_REGION, ROLES.REFERENT_DEPARTMENT, ROLES.RESPONSIBLE, ROLES.SUPERVISOR, ROLES.HEAD_CENTER, ROLES.VISITOR].includes(actor.role);
        Severity: Minor
        Found in packages/lib/src/roles.ts - About 2 hrs to fix

        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

        Avoid too many return statements within this function.
        New

            return [ROLES.ADMIN, ROLES.REFERENT_REGION, ROLES.REFERENT_DEPARTMENT, ROLES.TRANSPORTER, ROLES.ADMINISTRATEUR_CLE, ROLES.REFERENT_CLASSE].includes(actor.role);
        Severity: Major
        Found in packages/lib/src/roles.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          New

              return [ROLES.ADMIN, ROLES.REFERENT_REGION, ROLES.REFERENT_DEPARTMENT, ROLES.ADMINISTRATEUR_CLE, ROLES.REFERENT_CLASSE, ROLES.TRANSPORTER].includes(actor.role);
          Severity: Major
          Found in packages/lib/src/roles.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            New

                return [ROLES.ADMINISTRATEUR_CLE, ROLES.REFERENT_CLASSE].includes(actor.role);
            Severity: Major
            Found in packages/lib/src/roles.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              New

                  return [ROLES.ADMIN, ROLES.REFERENT_REGION, ROLES.REFERENT_DEPARTMENT].includes(actor.role);
              Severity: Major
              Found in packages/lib/src/roles.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                New

                  return false;
                Severity: Major
                Found in packages/lib/src/roles.ts - About 30 mins to fix

                  File constants.ts has 861 lines of code (exceeds 700 allowed). Consider refactoring.
                  New

                  const YOUNG_STATUS = {
                    WAITING_VALIDATION: "WAITING_VALIDATION",
                    WAITING_CORRECTION: "WAITING_CORRECTION",
                    REINSCRIPTION: "REINSCRIPTION",
                    VALIDATED: "VALIDATED",
                  Severity: Major
                  Found in packages/lib/src/constants/constants.ts - About 5 hrs to fix

                    File translation.ts has 1239 lines of code (exceeds 700 allowed). Consider refactoring.
                    New

                    import { FUNCTIONAL_ERRORS } from "./constants/functionalErrors";
                    
                    const translate = (value) => {
                      switch (value) {
                        case "WAITING_REALISATION":
                    Severity: Major
                    Found in packages/lib/src/translation.ts - About 1 day to fix

                      Function translate has 372 lines of code (exceeds 200 allowed). Consider refactoring.
                      New

                      const translate = (value) => {
                        switch (value) {
                          case "WAITING_REALISATION":
                            return "En attente de réalisation";
                          case "NONE":
                      Severity: Major
                      Found in packages/lib/src/translation.ts - About 7 hrs to fix

                        Function getRegionForEligibility has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        New

                        const getRegionForEligibility = (young) => {
                          let region = young.schooled === "true" ? young.schoolRegion : young.region;
                          if (!region) {
                            let dep = young?.schoolDepartment || young?.department || getDepartmentByZip(young?.zip);
                            if (dep && (!isNaN(dep) || ["2A", "2B", "02A", "02B"].includes(dep))) {
                        Severity: Minor
                        Found in packages/lib/src/region-and-departments.ts - About 1 hr to fix

                        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 getDepartmentForEligibility has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        New

                        const getDepartmentForEligibility = (young) => {
                          let dep;
                          if (young._id && young.schooled === "true") dep = young.schoolDepartment;
                          if (young._id && young.schooled === "false") dep = young.department;
                        
                        
                        Severity: Minor
                        Found in packages/lib/src/region-and-departments.ts - About 1 hr to fix

                        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 buildRequestPath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        New

                        export function buildRequestPath(path: BasicRoute["path"], params: BasicRoute["params"]): string {
                          let finalPath = path;
                          if (params && Object.keys(params).length > 0) {
                            for (const paramKey in params) {
                              const value = params[paramKey];
                        Severity: Minor
                        Found in packages/lib/src/utils/request.ts - About 55 mins to fix

                        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 excelExports.ts has 1091 lines of code (exceeds 700 allowed). Consider refactoring.
                        New

                        const translateIndexes = (index) => {
                          switch (index) {
                            case "young":
                              return "volontaires";
                            case "mission":
                        Severity: Major
                        Found in packages/lib/src/excelExports.ts - About 1 day to fix

                          File young.ts has 1952 lines of code (exceeds 700 allowed). Consider refactoring.
                          New

                          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";
                          Severity: Major
                          Found in packages/lib/src/mongoSchema/young.ts - About 4 days to fix

                            Function getCohortPeriod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            New

                            const getCohortPeriod = (cohort, withBold = false) => {
                              if (!cohort.dateStart || !cohort.dateEnd) return cohort.name || cohort;
                            
                              if(!shouldDisplayDateByCohortName(cohort.name)) {
                                return "à venir";
                            Severity: Minor
                            Found in packages/lib/src/sessions.ts - About 35 mins to fix

                            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 getCohortPeriodTemp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            New

                            const getCohortPeriodTemp = (young) => {
                              const { cohort, region } = young;
                              const cohortName = cohort.name || cohort;
                              if (cohortName === "Juillet 2023" && [...regionsListDROMS, "Polynésie française"].includes(region)) {
                                return "du 4 au 16 Juillet 2023";
                            Severity: Minor
                            Found in packages/lib/src/sessions.ts - About 25 mins to fix

                            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 hasAccessToReinscription has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            New

                            function hasAccessToReinscription(young) {
                              if (young.departSejourMotif === "Exclusion") {
                                return false;
                              }
                            
                            
                            Severity: Minor
                            Found in packages/lib/src/sessions.ts - About 1 hr to fix

                            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 canUpdateCohort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            New

                            export const canUpdateCohort = (cohort?: CohortDto, user?: UserDto | ReferentDto): boolean => {
                              if (!user) return false;
                              if (!cohort) return true;
                            
                              return (
                            Severity: Minor
                            Found in packages/lib/src/cohort/cohortService.ts - About 25 mins to fix

                            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 canUpdateCenter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            New

                            export const canUpdateCenter = (cohort: CohortDto | undefined, user: ReferentDto | undefined): boolean => {
                              if (!user) return false;
                              if (!cohort) return true;
                            
                              return (
                            Severity: Minor
                            Found in packages/lib/src/cohort/cohortService.ts - About 25 mins to fix

                            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 getFilterLabel has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            New

                            const getFilterLabel = (selected, placeholder = "Choisissez un filtre", prelabel = "") => {
                              if (Object.keys(selected).length === 0) return placeholder;
                              const translator = (item) => {
                                if (prelabel === "Statut phase 2") {
                                  return translation.translatePhase2(item);
                            Severity: Minor
                            Found in packages/lib/src/common.ts - About 1 hr to fix

                            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 getSelectedFilterLabel has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            New

                            const getSelectedFilterLabel = (selected, prelabel) => {
                              if (Array.isArray(selected)) {
                                if (selected[0] === "FROMDATE" && selected[2] === "TODATE") {
                                  const formatedFROMDATE = selected[1].split("-").reverse().join("/");
                                  const formatedTODATE = selected[3].split("-").reverse().join("/");
                            Severity: Minor
                            Found in packages/lib/src/common.ts - About 2 hrs to fix

                            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 youngCanChangeSession has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            New

                            const youngCanChangeSession = ({ statusPhase1, status, sessionPhase1Id, source, departSejourMotif }) => {
                              if (source === YOUNG_SOURCE.CLE) return false;
                              if ([YOUNG_STATUS.IN_PROGRESS, YOUNG_STATUS.WAITING_LIST, YOUNG_STATUS.WAITING_VALIDATION, YOUNG_STATUS.WAITING_CORRECTION].includes(status)) return true;
                              if ([YOUNG_STATUS_PHASE1.AFFECTED, YOUNG_STATUS_PHASE1.WAITING_AFFECTATION].includes(statusPhase1) && status === YOUNG_STATUS.VALIDATED) {
                                return true;
                            Severity: Minor
                            Found in packages/lib/src/common.ts - About 25 mins to fix

                            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 useReactSelectTheme has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                            New

                            export default function useReactSelectTheme({
                              error,
                              label,
                              isClearable,
                              isActive,
                            Severity: Minor
                            Found in packages/ds/src/admin/form/Select/theme.ts - About 4 hrs to fix

                            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.test.ts has 731 lines of code (exceeds 700 allowed). Consider refactoring.
                            New

                            import fetch from "node-fetch";
                            
                            import request from "supertest";
                            import jwt from "jsonwebtoken";
                            import { ROLES, COHORTS, YOUNG_SOURCE, SENDINBLUE_TEMPLATES } from "snu-lib";
                            Severity: Major
                            Found in api/src/__tests__/young.test.ts - About 2 hrs to fix

                              File ligne-de-bus.test.ts has 755 lines of code (exceeds 700 allowed). Consider refactoring.
                              New

                              import { Types } from "mongoose";
                              import request from "supertest";
                              import getAppHelper from "./helpers/app";
                              import { mockEsClient } from "./helpers/es";
                              import { SchemaDeRepartitionModel, LigneToPointModel, CohesionCenterModel, YoungModel, CohortModel, LigneBusModel, PlanTransportModel, PointDeRassemblementModel } from "../models";
                              Severity: Major
                              Found in api/src/__tests__/ligne-de-bus.test.ts - About 3 hrs to fix

                                File classe.test.ts has 899 lines of code (exceeds 700 allowed). Consider refactoring.
                                New

                                import request from "supertest";
                                import passport from "passport";
                                import { Types } from "mongoose";
                                const { ObjectId } = Types;
                                import emailsEmitter from "../../emails";
                                Severity: Major
                                Found in api/src/__tests__/cle/classe.test.ts - About 6 hrs to fix

                                  Function initPlanTransport has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  New

                                  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;
                                  Severity: Minor
                                  Found in api/src/__tests__/helpers/PlanDeTransport/planDeTransport.ts - About 1 hr to fix

                                  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 mapAppelAProjetDemarcheSimplifieeDtoToAppelAProjet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  New

                                  export const mapAppelAProjetDemarcheSimplifieeDtoToAppelAProjet = (appelAProjetDto: DemarcheSimplifieeDto, appelAProjetOptions: IAppelAProjetOptions): IAppelAProjet[] => {
                                    return appelAProjetDto.data.demarche.dossiers.nodes.map((formulaire) => {
                                      const etablissement: IAppelAProjet["etablissement"] = {} as IAppelAProjet["etablissement"];
                                      const referentEtablissement: IAppelAProjet["referentEtablissement"] = {} as IAppelAProjet["referentEtablissement"];
                                      const classe: IAppelAProjet["classe"] = {} as IAppelAProjet["classe"];
                                  Severity: Minor
                                  Found in api/src/providers/demarcheSimplifiee/demarcheSimplifieeProvider.ts - About 25 mins to fix

                                  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 15 (exceeds 5 allowed). Consider refactoring.
                                  New

                                  function render(doc, { young, session, cohort, center, service, meetingPoint, ligneBus, ligneToPoint }) {
                                    let _y;
                                    const page = doc.page;
                                  
                                    const contacts = service?.contacts.filter((c) => c.cohort === young.cohort).slice(0, 4) || [];
                                  Severity: Minor
                                  Found in api/src/templates/convocation/cohesion.ts - About 1 hr to fix

                                  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 checkBox has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  New

                                  export function checkBox(doc, x, y, fillColor, checked = false) {
                                  Severity: Minor
                                  Found in api/src/templates/templateService.ts - About 35 mins to fix

                                    Function initDocument has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    New

                                    export function initDocument(top, bottom, left, right, options = {}) {
                                    Severity: Minor
                                    Found in api/src/templates/templateService.ts - About 35 mins to fix

                                      Function render has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      New

                                      function render(doc: typeof PDFDocument, young, session, cohort, cohesionCenter) {
                                      Severity: Minor
                                      Found in api/src/templates/certificate/phase1.ts - About 35 mins to fix

                                        Function generateBatchCertifPhase1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        New

                                        function generateBatchCertifPhase1(outStream, youngs, session, cohort, cohesionCenter) {
                                        Severity: Minor
                                        Found in api/src/templates/certificate/phase1.ts - About 35 mins to fix

                                          Function getCohesionCenter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                          New

                                          const getCohesionCenter = async (young) => {
                                            let cohesionCenter;
                                          
                                            let session = await SessionPhase1Model.findById(young.sessionPhase1Id);
                                            let cohesionId = session?.cohesionCenterId || young?.cohesionCenterId;
                                          Severity: Minor
                                          Found in api/src/templates/certificate/phase1.ts - About 35 mins to fix

                                          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.
                                          New

                                          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");
                                          
                                          
                                          Severity: Minor
                                          Found in api/src/templates/droitImage/droitImage.ts - About 1 hr to fix

                                          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 getMailParams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          New

                                          function getMailParams(type: string, template: string, young: YoungDto, contract?: ContractDto | null) {
                                            if (type === "certificate" && template === "1")
                                              return {
                                                object: `Attestation de fin de phase 1 de ${young.firstName}`,
                                                message: `Vous trouverez en pièce-jointe de ce mail l'attestation de réalisation de phase 1 du SNU.`,
                                          Severity: Minor
                                          Found in api/src/young/youngSendDocumentEmailService.ts - About 45 mins to fix

                                          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 sendEmailToYoung has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                          New

                                          export async function sendEmailToYoung(template: string, young, params: EmailParams = {}) {
                                            const { cta, message, missionName, structureName, type_document, object, link } = params;
                                            let buttonCta = cta || config.APP_URL;
                                            if (template === SENDINBLUE_TEMPLATES.young.MILITARY_PREPARATION_DOCS_CORRECTION) buttonCta = `${config.APP_URL}/ma-preparation-militaire`;
                                            if (template === SENDINBLUE_TEMPLATES.young.INSCRIPTION_STARTED)
                                          Severity: Minor
                                          Found in api/src/young/email/youngEmailService.ts - About 55 mins to fix

                                          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 fetchDataForYoungCertificate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                          New

                                          export const fetchDataForYoungCertificate = async (young: YoungDto) => {
                                            const session = await SessionPhase1Model.findById(young.sessionPhase1Id);
                                            if (!session) throw new Error(`session ${young.sessionPhase1Id} not found for young ${young._id}`);
                                            const center = await CohesionCenterModel.findById(session.cohesionCenterId);
                                            if (!center) throw new Error(`center ${session.cohesionCenterId} not found for young ${young._id} - session ${session._id}`);
                                          Severity: Minor
                                          Found in api/src/young/youngCertificateService.ts - About 55 mins to fix

                                          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 getValidatedYoungsWithSession has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          New

                                          export const getValidatedYoungsWithSession = (youngs: YoungDto[]) => {
                                            const validStatus: Record<string, boolean> = {
                                              [YOUNG_STATUS_PHASE1.AFFECTED]: true,
                                              [YOUNG_STATUS_PHASE1.DONE]: true,
                                              [YOUNG_STATUS_PHASE1.NOT_DONE]: true,
                                          Severity: Minor
                                          Found in api/src/young/youngService.ts - About 45 mins to fix

                                          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

                                          Consider simplifying this complex logical expression.
                                          New

                                                if (
                                                  !young.parent2Status ||
                                                  !young.parent1AllowSNU ||
                                                  young.parent1AllowSNU === "false" ||
                                                  young.parent2AllowSNU === "false" ||
                                          Severity: Major
                                          Found in api/src/young/edition/youngEditionController.ts - About 1 hr to fix

                                            Function filterAppelAProjetsSameUaiButDifferentEmailChefEtablissement has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                            New

                                              filterAppelAProjetsSameUaiButDifferentEmailChefEtablissement(
                                                appelAProjets: IAppelAProjet[],
                                                appelAProjetOptions: IAppelAProjetOptions,
                                              ): {
                                                retained: IAppelAProjet[];
                                            Severity: Minor
                                            Found in api/src/cle/appelAProjetCle/appelAProjetService.ts - About 1 hr to fix

                                            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 processReferentEtablissement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                            New

                                              async processReferentEtablissement(appelAProjet: IAppelAProjet, save: boolean): Promise<string> {
                                                const referentEtablissement = await ReferentModel.findOne({ email: appelAProjet.referentEtablissement.email });
                                                const hasAlreadyBeenProcessed = this.referents.some((referent) => referent.email === appelAProjet.referentEtablissement.email);
                                                const alreadyProcessedEtablissement = this.etablissements.find((etablissement) => etablissement.uai === appelAProjet.etablissement.uai);
                                                const referentMetadata: ReferentType["metadata"] = { createdBy: ReferentCreatedBy.SYNC_APPEL_A_PROJET_2024_2025, isFirstInvitationPending: true };
                                            Severity: Minor
                                            Found in api/src/cle/appelAProjetCle/appelAProjetReferentService.ts - About 1 hr to fix

                                            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 processReferentClasse has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                            New

                                              async processReferentClasse(appelAProjet: IAppelAProjet, save: boolean): Promise<string> {
                                                const existingReferentClasse = await ReferentModel.findOne({ email: appelAProjet.referentClasse?.email });
                                                const hasAlreadyBeenProcessed = this.referents.some((referent) => referent.email === appelAProjet.referentClasse?.email);
                                                const referentMetadata: ReferentType["metadata"] = { createdBy: ReferentCreatedBy.SYNC_APPEL_A_PROJET_2024_2025, isFirstInvitationPending: true };
                                            
                                            
                                            Severity: Minor
                                            Found in api/src/cle/appelAProjetCle/appelAProjetReferentService.ts - About 1 hr to fix

                                            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 processEtablissement has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                            New

                                              async processEtablissement(
                                                appelAProjet: IAppelAProjet,
                                                etablissements: EtablissementProviderDto[],
                                                referentEtablissementId,
                                                save: boolean,
                                            Severity: Minor
                                            Found in api/src/cle/appelAProjetCle/appelAProjetEtablissementService.ts - About 1 hr to fix

                                            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 updateReferentsForMultipleClasses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            New

                                            export async function updateReferentsForMultipleClasses(
                                              referentsClassesToUpdate: (UpdateReferentClasse & {
                                                classeId: string;
                                              })[],
                                              user: UserDto,
                                            Severity: Minor
                                            Found in api/src/cle/classes/classesService.ts - About 35 mins to fix

                                            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 compute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                            New

                                              compute: async (_id, fromUser, options) => {
                                                const YoungModel = options?.YoungModel; // Prevent circular dependency in YoungModel post save hook
                                                if (!YoungModel) throw new Error("YoungModel is required");
                                            
                                                let classe = await ClasseModel.findById(_id);
                                            Severity: Minor
                                            Found in api/src/cle/classe/stateManager.ts - About 55 mins to fix

                                            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 deleteClasse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            New

                                            export const deleteClasse = async (_id: string, fromUser: object) => {
                                              let classe = await ClasseModel.findById(_id);
                                              if (!classe) throw new Error("Classe not found");
                                              if (classe.deletedAt) throw new Error("Classe already deleted");
                                              if (classe.cohesionCenterId) throw new Error("Classe already linked to a cohesion center");
                                            Severity: Minor
                                            Found in api/src/cle/classe/classeService.ts - About 25 mins to fix

                                            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

                                            Consider simplifying this complex logical expression.
                                            New

                                                if (req.query.type === "schema-de-repartition") {
                                                  const centres = await findCohesionCentersForClasses(classes);
                                                  const pdrs = await findPdrsForClasses(classes);
                                                  const youngs = await getYoungsGroupByClasses(classes);
                                                  const lignesBus = await findLigneInfoForClasses(classes);
                                            Severity: Critical
                                            Found in api/src/cle/classe/classeController.ts - About 1 hr to fix

                                              File validator.ts has 764 lines of code (exceeds 700 allowed). Consider refactoring.
                                              New

                                              import Joi from "joi";
                                              import { ROLES_LIST, SUB_ROLES_LIST, VISITOR_SUB_ROLES_LIST, PHONE_ZONES_NAMES_ARR, UserDto, YoungDto } from "snu-lib";
                                              import { isYoung } from "../utils";
                                              
                                              // Source: https://github.com/mkg20001/joi-objectid/blob/71b2a8c0ccd31153e4efd3e7c10602b4385242f6/index.js#L12
                                              Severity: Major
                                              Found in api/src/utils/validator.ts - About 3 hrs to fix

                                                Function validateYoung has 270 lines of code (exceeds 200 allowed). Consider refactoring.
                                                New

                                                export function validateYoung(young: YoungDto, user?: UserDto) {
                                                  const keys = {
                                                    firstName: Joi.string().allow(null, ""),
                                                    lastName: Joi.string().allow(null, ""),
                                                    frenchNationality: Joi.string().allow(null, ""),
                                                Severity: Major
                                                Found in api/src/utils/validator.ts - About 3 hrs to fix

                                                  Function generatePdfIntoStream has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                                  New

                                                  export async function generatePdfIntoStream(outStream, { type, template, young, contract }) {
                                                    if (type === "certificate" && template === "1" && young) {
                                                      return await generateCertifPhase1(outStream, young);
                                                    }
                                                    if (type === "certificate" && template === "2" && young) {
                                                  Severity: Minor
                                                  Found in api/src/utils/pdf-renderer.ts - About 1 hr to fix

                                                  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

                                                  Avoid deeply nested control flow statements.
                                                  New

                                                              if (!result[youngLigneBus.busId]) {
                                                                result[youngLigneBus.busId] = {};
                                                                result[youngLigneBus.busId]["youngs"] = [];
                                                                result[youngLigneBus.busId]["ligneBus"] = [];
                                                                result[youngLigneBus.busId]["meetingPoint"] = [];
                                                  Severity: Major
                                                  Found in api/src/controllers/session-phase1.ts - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    New

                                                                if (!result[youngLigneBus.busId]["meetingPoint"].find((meetingPoint) => meetingPoint._id.toString() === youngMeetingPoint._id.toString())) {
                                                                  result[youngLigneBus.busId]["meetingPoint"].push(youngMeetingPoint);
                                                                }
                                                    Severity: Major
                                                    Found in api/src/controllers/session-phase1.ts - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      New

                                                                  if (!result[youngLigneBus.busId]["ligneBus"].find((ligne) => ligne._id.toString() === young.ligneId)) {
                                                                    result[youngLigneBus.busId]["ligneBus"].push(youngLigneBus);
                                                                  }
                                                      Severity: Major
                                                      Found in api/src/controllers/session-phase1.ts - About 45 mins to fix

                                                        Function findOrCreateReferent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        New

                                                        export const findOrCreateReferent = async (referent, { etablissement, role, subRole }: { etablissement: EtablissementType; role: string; subRole?: string }) => {
                                                          try {
                                                            // Return if already exists
                                                            if (referent._id) return referent;
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in api/src/services/cle/referent.ts - About 25 mins to fix

                                                        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 doInviteMultipleChefsEtablissements has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        New

                                                        export const doInviteMultipleChefsEtablissements = async (user: UserDto) => {
                                                          const chefsEtablissementsToSendInvitation = await ReferentModel.find({
                                                            "metadata.isFirstInvitationPending": true,
                                                            role: ROLES.ADMINISTRATEUR_CLE,
                                                            subRole: SUB_ROLES.referent_etablissement,
                                                        Severity: Minor
                                                        Found in api/src/services/cle/referent.ts - About 25 mins to fix

                                                        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 doInviteMultipleReferentClasseVerifiee has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        New

                                                        export const doInviteMultipleReferentClasseVerifiee = async (user: UserDto) => {
                                                          const referentsClasseToSendInvitation = await findReferentsClasseToSendInvitationByClasseStatus(STATUS_CLASSE.VERIFIED);
                                                          const invitations: InvitationResult[] = [];
                                                          let processCounter = 1;
                                                          for (const referentClasse of referentsClasseToSendInvitation) {
                                                        Severity: Minor
                                                        Found in api/src/services/cle/referent.ts - About 25 mins to fix

                                                        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 formatParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                        New

                                                        export function formatParams(filters: { key: string; value: string | string[] }[], page: number, size?: number): string {
                                                          const type = filters.find((filter) => filter.key === "type")?.value ?? [];
                                                          size = size ?? 20;
                                                        
                                                          let where = "";
                                                        Severity: Minor
                                                        Found in api/src/services/gouv.fr/api-education.ts - About 25 mins to fix

                                                        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 validatePdtFile has a Cognitive Complexity of 220 (exceeds 5 allowed). Consider refactoring.
                                                        New

                                                        export const validatePdtFile = async (
                                                          filePath: string,
                                                          cohortName: string,
                                                          isCle: boolean,
                                                        ): Promise<{
                                                        Severity: Minor
                                                        Found in api/src/pdt/import/pdtImportService.ts - About 4 days to fix

                                                        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 computeImportSummary has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                                        New

                                                        export const computeImportSummary = (lines: PdtLine[]) => {
                                                          const countPdr = getLinePdrCount(lines[0]);
                                                          let maxPdrOnLine = 0;
                                                          for (const line of lines.entries()) {
                                                            const currentLinePDRCount = getLinePdrIds(line).length;
                                                        Severity: Minor
                                                        Found in api/src/pdt/import/pdtImportService.ts - About 1 hr to fix

                                                        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 validatePdtFile has 318 lines of code (exceeds 200 allowed). Consider refactoring.
                                                        New

                                                        export const validatePdtFile = async (
                                                          filePath: string,
                                                          cohortName: string,
                                                          isCle: boolean,
                                                        ): Promise<{
                                                        Severity: Major
                                                        Found in api/src/pdt/import/pdtImportService.ts - About 5 hrs to fix

                                                          Avoid deeply nested control flow statements.
                                                          New

                                                                    if (line["NUMERO DE LIGNE"] === mergedLine) {
                                                                      found = true;
                                                                      break;
                                                                    }
                                                          Severity: Major
                                                          Found in api/src/pdt/import/pdtImportService.ts - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            New

                                                                      if (!pdr) {
                                                                        errors[`ID PDR ${pdrNumber}`].push({ line: index, error: PDT_IMPORT_ERRORS.BAD_PDR_ID, extra: line[`ID PDR ${pdrNumber}`] });
                                                                      } else if ((pdr?.department || "").toLowerCase() !== departmentLookUp[line[`N° DE DEPARTEMENT PDR ${pdrNumber}`]]?.toLowerCase()) {
                                                                        errors[`ID PDR ${pdrNumber}`].push({ line: index, error: PDT_IMPORT_ERRORS.BAD_PDR_DEPARTEMENT, extra: line[`ID PDR ${pdrNumber}`] });
                                                                      }
                                                            Severity: Major
                                                            Found in api/src/pdt/import/pdtImportService.ts - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              New

                                                                      } else if (!["correspondance aller", "correspondance retour", "correspondance"].includes(line[`ID PDR ${pdrNumber}`]?.toLowerCase())) {
                                                                        errors[`ID PDR ${pdrNumber}`].push({ line: index, error: PDT_IMPORT_ERRORS.BAD_PDR_ID, extra: line[`ID PDR ${pdrNumber}`] });
                                                                      }
                                                              Severity: Major
                                                              Found in api/src/pdt/import/pdtImportService.ts - About 45 mins to fix

                                                                Function api has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                New

                                                                const api = async (path, options: any = {}, force?: boolean) => {
                                                                  try {
                                                                    if (!config.ENABLE_SENDINBLUE && !force) {
                                                                      logger.warn("Not possible to use BREVO api as ENABLE_SENDINBLUE is disabled");
                                                                      return;
                                                                Severity: Minor
                                                                Found in api/src/brevo.ts - About 35 mins to fix

                                                                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 sendEmail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                New

                                                                export async function sendEmail(to: Email[], subject: string, htmlContent, { params, attachment, cc, bcc }: Omit<SendMailParameters, "emailTo"> = {}) {
                                                                  try {
                                                                    if (config.get("MAIL_TRANSPORT") === "SMTP") {
                                                                      await sendMailCatcher(subject, htmlContent, { emailTo: to, cc, bcc, attachment });
                                                                      return;
                                                                Severity: Minor
                                                                Found in api/src/brevo.ts - About 55 mins to fix

                                                                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 sendTemplate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                                                New

                                                                export async function sendTemplate(id: string, { params, emailTo, cc, bcc, attachment }: SendMailParameters, options: SendTemplateOptions = {}) {
                                                                  try {
                                                                    if (!id) throw new Error("No template id provided");
                                                                
                                                                    if (!options.force && config.get("MAIL_TRANSPORT") === "SMTP") {
                                                                Severity: Minor
                                                                Found in api/src/brevo.ts - About 1 hr to fix

                                                                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 sync has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                                                New

                                                                export async function sync(obj, type, { force } = { force: false }) {
                                                                  if (config.ENVIRONMENT !== "production" && !force) {
                                                                    logger.debug("no sync brevo");
                                                                    return;
                                                                  }
                                                                Severity: Minor
                                                                Found in api/src/brevo.ts - About 2 hrs to fix

                                                                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 1414 lines of code (exceeds 700 allowed). Consider refactoring.
                                                                New

                                                                import express, { Response } from "express";
                                                                import { logger } from "../logger";
                                                                import passport from "passport";
                                                                import crypto from "crypto";
                                                                import jwt from "jsonwebtoken";
                                                                Severity: Major
                                                                Found in api/src/referent/referentController.ts - About 2 days to fix

                                                                  Function updateTutorNameInMissionsAndApplications has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                                                  New

                                                                  async function updateTutorNameInMissionsAndApplications(tutor, fromUser) {
                                                                    if (!tutor || !tutor.firstName || !tutor.lastName) return;
                                                                  
                                                                    const missions = await MissionModel.find({ tutorId: tutor._id });
                                                                    // Update missions
                                                                  Severity: Minor
                                                                  Found in api/src/referent/referentController.ts - About 1 hr to fix

                                                                  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 populateReferent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                                                  New

                                                                  async function populateReferent(ref) {
                                                                    if (ref.subRole === SUB_ROLES.referent_etablissement) {
                                                                      const etablissement = await EtablissementModel.findOne({ referentEtablissementIds: ref._id }).lean();
                                                                      if (!etablissement) throw new Error(ERRORS.NOT_FOUND);
                                                                      // Do not return res.status(404).send() in a helper function, only at the root of the route handler.
                                                                  Severity: Minor
                                                                  Found in api/src/referent/referentController.ts - About 1 hr to fix

                                                                  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

                                                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                                                  New

                                                                                        <div>
                                                                                          <h2>CHARTE DE LA RÉSERVE CIVIQUE</h2>
                                                                                          <h3>1° Principes directeurs</h3>
                                                                                          <p>
                                                                                            La réserve civique permet à toute personne qui le souhaite de s&apos;engager à servir les valeurs de la République en participant à des missions
                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 3 other locations - About 1 day to fix
                                                                  admin/src/components/Contract.jsx on lines 1397..1482
                                                                  app/src/scenes/contract/index.jsx on lines 376..459
                                                                  app/src/scenes/contract/index.jsx on lines 835..918

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 519.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                                                  New

                                                                                    <div>
                                                                                      <h2>CHARTE DE LA RÉSERVE CIVIQUE</h2>
                                                                                      <h3>1° Principes directeurs</h3>
                                                                                      <p>
                                                                                        La réserve civique permet à toute personne qui le souhaite de s&apos;engager à servir les valeurs de la République en participant à des missions
                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 3 other locations - About 1 day to fix
                                                                  admin/src/components/Contract.jsx on lines 665..755
                                                                  app/src/scenes/contract/index.jsx on lines 376..459
                                                                  app/src/scenes/contract/index.jsx on lines 835..918

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 519.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    const setStatus = async (status, message, duration) => {
                                                                      try {
                                                                        const { ok, code, data } = await api.put("/application", { _id: application._id, status, missionDuration: duration });
                                                                        if (!ok) return toastr.error("Une erreur s'est produite :", translate(code));
                                                                        setApplication(data);
                                                                  Severity: Major
                                                                  Found in admin/src/components/selectStatusApplication.jsx and 1 other location - About 1 day to fix
                                                                  admin/src/scenes/volontaires/view/phase2bis/components/SelectStatusApplicationPhase2.jsx on lines 92..111

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 390.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                          <ul className="mt-[8px]">
                                                                            <li>
                                                                              <a href="https://www.gouvernement.fr/" target="_blank" rel="noreferrer">
                                                                                gouvernement.fr
                                                                              </a>
                                                                  Severity: Major
                                                                  Found in admin/src/components/footer.jsx and 1 other location - About 7 hrs to fix
                                                                  app/src/components/footer.jsx on lines 37..73

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 289.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  async function exploreDir(basedir, dir, relativeDir) {
                                                                    const uniqueId = getNextUniqueId();
                                                                    let context = {
                                                                      title: dir,
                                                                      folders: [],
                                                                  Severity: Major
                                                                  Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 7 hrs to fix
                                                                  app/src/utils/generate-assets-presentation-page.js on lines 33..58

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 286.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        const { error: filesError, value: files } = Joi.array()
                                                                          .items(
                                                                            Joi.alternatives().try(
                                                                              Joi.object({
                                                                                name: Joi.string().required(),
                                                                  Severity: Major
                                                                  Found in api/src/controllers/young/documents.js and 1 other location - About 6 hrs to fix
                                                                  api/src/controllers/SNUpport.js on lines 416..436

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 278.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                      const { error: filesError, value: files } = Joi.array()
                                                                        .items(
                                                                          Joi.alternatives().try(
                                                                            Joi.object({
                                                                              name: Joi.string().required(),
                                                                  Severity: Major
                                                                  Found in api/src/controllers/SNUpport.js and 1 other location - About 6 hrs to fix
                                                                  api/src/controllers/young/documents.js on lines 118..138

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 278.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  function createFolderView(context, imports) {
                                                                    // --- prepare elements
                                                                    const components = [];
                                                                    const title = `<div className="${titleClass}">${context.title}</div>`;
                                                                    for (const item of context.components) {
                                                                  Severity: Major
                                                                  Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 6 hrs to fix
                                                                  app/src/utils/generate-assets-presentation-page.js on lines 139..157

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 264.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                                          {!isYoungAdult ? (
                                                                                            <>
                                                                                              <div>
                                                                                                Le volontaire, <ContractField name="youngFirstName" placeholder="Prénom" context={context} />
                                                                                                <ContractField name="youngLastName" placeholder="Nom" context={context} />
                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 1 day to fix
                                                                  admin/src/components/Contract.jsx on lines 1337..1395

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 520.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                                      {!isYoungAdult ? (
                                                                                        <>
                                                                                          <div>
                                                                                            Le volontaire, <ContractField name="youngFirstName" placeholder="Prénom" context={context} />
                                                                                            <ContractField name="youngLastName" placeholder="Nom" context={context} />
                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 1 day to fix
                                                                  admin/src/components/Contract.jsx on lines 605..663

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 520.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  export const useFileUpload = () => {
                                                                    const [files, setFiles] = useState([]);
                                                                    const [error, setError] = useState("");
                                                                  
                                                                    const addFiles = useCallback(
                                                                  Severity: Major
                                                                  Found in admin/src/components/FileUpload.jsx and 1 other location - About 5 hrs to fix
                                                                  app/src/components/FileUpload.jsx on lines 79..109

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 250.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        try {
                                                                          const controller = new AbortController();
                                                                          const { signal } = controller;
                                                                  
                                                                          window.addEventListener("beforeunload", () => controller.abort());
                                                                  Severity: Major
                                                                  Found in admin/src/services/api.js and 1 other location - About 5 hrs to fix
                                                                  app/src/services/api.js on lines 130..163

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 250.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.get("/:id", passport.authenticate(["referent", "young"], { session: false, failWithError: true }), async (req, res) => {
                                                                    try {
                                                                      const { error, value: checkedId } = validateId(req.params.id);
                                                                      if (error) {
                                                                        capture(error);
                                                                  Severity: Major
                                                                  Found in api/src/controllers/program.js and 1 other location - About 4 hrs to fix
                                                                  api/src/controllers/program.js on lines 107..121

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 228.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.get("/public/engagement/:id", async (req, res) => {
                                                                    try {
                                                                      const { error, value: checkedId } = validateId(req.params.id);
                                                                      if (error) {
                                                                        capture(error);
                                                                  Severity: Major
                                                                  Found in api/src/controllers/program.js and 1 other location - About 4 hrs to fix
                                                                  api/src/controllers/program.js on lines 46..60

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 228.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    const onClickStatus = (status) => {
                                                                      if (status === MISSION_STATUS.CANCEL) {
                                                                        setModalConfirmWithMessage({
                                                                          isOpen: true,
                                                                          onConfirm: (statusComment) => onConfirmStatus(status, statusComment),
                                                                  Severity: Major
                                                                  Found in admin/src/components/selectStatusMission.jsx and 1 other location - About 4 hrs to fix
                                                                  admin/src/scenes/missions/components/SelectStatusMissionV2.jsx on lines 34..61

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 223.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  export function getPages(lastDisplayItem, firstDisplayPage, lastDisplayPage, itemsCountTotal, lastPage, size) {
                                                                    let pages = [];
                                                                    if (lastDisplayItem === itemsCountTotal) {
                                                                      // derniere page
                                                                      for (let i = firstDisplayPage - 1; i <= lastDisplayPage - 1; ++i) pages.push(i);
                                                                  Severity: Major
                                                                  Found in admin/src/utils/pagination.utils.js and 1 other location - About 4 hrs to fix
                                                                  app/src/utils/pagination.utils.js on lines 1..14

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 220.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  export default function IconDomain({ domain, bgStyle = null, iconStyle = "text-white h-8 w-8" }) {
                                                                    const [icon, setIcon] = React.useState(null);
                                                                  
                                                                    React.useEffect(() => {
                                                                      switch (domain) {
                                                                  Severity: Major
                                                                  Found in admin/src/components/IconDomain.jsx and 1 other location - About 7 hrs to fix
                                                                  admin/src/components/IconDomainRounded.jsx on lines 14..59

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  export default function IconDomain({ domain, bgStyle = null, iconStyle = "text-white h-8 w-8" }) {
                                                                    const [icon, setIcon] = React.useState(null);
                                                                  
                                                                    React.useEffect(() => {
                                                                      switch (domain) {
                                                                  Severity: Major
                                                                  Found in admin/src/components/IconDomainRounded.jsx and 1 other location - About 7 hrs to fix
                                                                  admin/src/components/IconDomain.jsx on lines 14..59

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                      if (isReferent(req.user)) {
                                                                        if (!canCreateYoungApplication(req.user, young)) {
                                                                          return res.status(403).send({ ok: false, code: ERRORS.OPERATION_NOT_ALLOWED });
                                                                        }
                                                                        if (req.user.role === ROLES.RESPONSIBLE) {
                                                                  Severity: Major
                                                                  Found in api/src/controllers/application.js and 1 other location - About 7 hrs to fix
                                                                  api/src/controllers/application.js on lines 542..559

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                      if (isReferent(req.user)) {
                                                                        if (!canCreateYoungApplication(req.user, young)) {
                                                                          return res.status(403).send({ ok: false, code: ERRORS.OPERATION_NOT_ALLOWED });
                                                                        }
                                                                        if (req.user.role === ROLES.RESPONSIBLE) {
                                                                  Severity: Major
                                                                  Found in api/src/controllers/application.js and 1 other location - About 7 hrs to fix
                                                                  api/src/controllers/application.js on lines 345..362

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        if (isEmailValidationEnabled) {
                                                                          await sendTemplate(SENDINBLUE_TEMPLATES.SIGNUP_EMAIL_VALIDATION, {
                                                                            emailTo: [{ name: `${user.firstName} ${user.lastName}`, email }],
                                                                            params: {
                                                                              registration_code: tokenEmailValidation,
                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 3 hrs to fix
                                                                  api/src/auth.js on lines 333..350

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 202.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        if (isEmailValidationEnabled) {
                                                                          await sendTemplate(SENDINBLUE_TEMPLATES.SIGNUP_EMAIL_VALIDATION, {
                                                                            emailTo: [{ name: `${user.firstName} ${user.lastName}`, email }],
                                                                            params: {
                                                                              registration_code: tokenEmailValidation,
                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 3 hrs to fix
                                                                  api/src/auth.js on lines 183..200

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 202.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                                  <div style={{ display: "flex", justifyContent: "center", marginBottom: 20 }}>
                                                                                    <LoadingButton
                                                                                      onClick={async () => {
                                                                                        if (contract?.invitationSent === "true") {
                                                                                          const confirmText =
                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 5 hrs to fix
                                                                  admin/src/components/Contract.jsx on lines 1486..1530

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 393.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                              <div style={{ display: "flex", justifyContent: "center", marginBottom: 20 }}>
                                                                                <LoadingButton
                                                                                  onClick={async () => {
                                                                                    if (contract?.invitationSent === "true") {
                                                                                      const confirmText =
                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 5 hrs to fix
                                                                  admin/src/components/Contract.jsx on lines 759..803

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 393.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  export const copyToClipboard = (text) => {
                                                                    if (navigator.clipboard && window.isSecureContext) {
                                                                      return navigator.clipboard.writeText(text);
                                                                    } else {
                                                                      const textArea = document.createElement("textarea");
                                                                  Severity: Major
                                                                  Found in admin/src/utils/index.jsx and 1 other location - About 2 hrs to fix
                                                                  app/src/utils/index.js on lines 124..140

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 184.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        if (error) {
                                                                          if (error.details[0].path.find((e) => e === "email")) return res.status(400).send({ ok: false, user: null, code: ERRORS.EMAIL_INVALID });
                                                                          if (error.details[0].path.find((e) => e === "password")) return res.status(400).send({ ok: false, user: null, code: ERRORS.PASSWORD_NOT_VALIDATED });
                                                                          return res.status(400).send({ ok: false, code: ERRORS.INVALID_PARAMS });
                                                                        }
                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 2 hrs to fix
                                                                  api/src/auth.js on lines 243..247

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 183.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        if (error) {
                                                                          if (error.details[0].path.find((e) => e === "email")) return res.status(400).send({ ok: false, user: null, code: ERRORS.EMAIL_INVALID });
                                                                          if (error.details[0].path.find((e) => e === "password")) return res.status(400).send({ ok: false, user: null, code: ERRORS.PASSWORD_NOT_VALIDATED });
                                                                          return res.status(400).send({ ok: false, code: ERRORS.INVALID_PARAMS });
                                                                        }
                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 2 hrs to fix
                                                                  api/src/auth.js on lines 102..106

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 183.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    const setStatus = async (status, statusComment = "") => {
                                                                      try {
                                                                        const { ok, code, data: newMission } = await api.put(`/mission/${mission._id}`, { ...mission, status, statusComment });
                                                                        if (!ok) return toastr.error("Une erreur s'est produite :", translate(code));
                                                                        setMission(newMission);
                                                                  Severity: Major
                                                                  Found in admin/src/components/selectStatusMission.jsx and 1 other location - About 1 hr to fix
                                                                  admin/src/scenes/missions/components/SelectStatusMissionV2.jsx on lines 69..80

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 171.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        <div className={`flex flex-col md:flex-row ${files.length === 0 && "flex-row"} mt-4 w-full`}>
                                                                          <div>
                                                                            <label htmlFor="file-upload" className={`cursor-pointer ${disabled && "cursor-not-allowed"} rounded bg-[#EEEEEE] py-2 px-3 text-sm text-gray-600`}>
                                                                              Parcourir...
                                                                            </label>
                                                                  Severity: Major
                                                                  Found in admin/src/components/FileUpload.jsx and 1 other location - About 2 hrs to fix
                                                                  app/src/components/FileUpload.jsx on lines 42..74

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 336.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                      if (key === "cohesionStayPresence" && newValue === "true") {
                                                                        let emailTo = [{ name: `${young.parent1FirstName} ${young.parent1LastName}`, email: young.parent1Email }];
                                                                        if (young.parent2Email) emailTo.push({ name: `${young.parent2FirstName} ${young.parent2LastName}`, email: young.parent2Email });
                                                                        await sendTemplate(SENDINBLUE_TEMPLATES.YOUNG_ARRIVED_IN_CENTER_TO_REPRESENTANT_LEGAL, {
                                                                          emailTo,
                                                                  Severity: Major
                                                                  Found in api/src/controllers/young/phase1.js and 1 other location - About 1 hr to fix
                                                                  api/src/controllers/young/index.js on lines 1060..1070

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 163.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                        if (key === "cohesionStayPresence" && newValue === "true") {
                                                                          let emailTo = [{ name: `${young.parent1FirstName} ${young.parent1LastName}`, email: young.parent1Email }];
                                                                          if (young.parent2Email) emailTo.push({ name: `${young.parent2FirstName} ${young.parent2LastName}`, email: young.parent2Email });
                                                                          await sendTemplate(SENDINBLUE_TEMPLATES.YOUNG_ARRIVED_IN_CENTER_TO_REPRESENTANT_LEGAL, {
                                                                            emailTo,
                                                                  Severity: Major
                                                                  Found in api/src/controllers/young/index.js and 1 other location - About 1 hr to fix
                                                                  api/src/controllers/young/phase1.js on lines 336..346

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 163.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  function addComponent(file, dir, uniqueId) {
                                                                    const dotIndex = file.lastIndexOf(".");
                                                                    let componentName = slugify(file.substring(0, dotIndex), { strict: true, trim: true, lower: true, replacement: "_" }) + "_" + uniqueId;
                                                                    componentName = componentName.substring(0, 1).toUpperCase() + componentName.substring(1);
                                                                    return {
                                                                  Severity: Minor
                                                                  Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 55 mins to fix
                                                                  app/src/utils/generate-assets-presentation-page.js on lines 71..81

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 159.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.get("/:id", passport.authenticate("referent", { session: false, failWithError: true }), async (req, res) => {
                                                                    try {
                                                                      const { error, value: id } = validateId(req.params.id);
                                                                      if (error) {
                                                                        capture(error);
                                                                  Severity: Major
                                                                  Found in api/src/controllers/bus.js and 1 other location - About 1 hr to fix
                                                                  api/src/controllers/dashboard/alerte-message.js on lines 24..41

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 311.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.post("/data-verification", tokenParentValidMiddleware, async (req, res) => {
                                                                    try {
                                                                      // --- validate data
                                                                      const { error: error_id } = Joi.boolean().valid(true).required().validate(req.body.verified);
                                                                      if (error_id) {
                                                                  Severity: Minor
                                                                  Found in api/src/controllers/representants-legaux.js and 1 other location - About 40 mins to fix
                                                                  api/src/controllers/representants-legaux.js on lines 361..382

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 304.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.post("/cni-invalide", tokenParentValidMiddleware, async (req, res) => {
                                                                    try {
                                                                      // --- validate data
                                                                      const { error: error_id } = Joi.boolean().valid(true).required().validate(req.body.validated);
                                                                      if (error_id) {
                                                                  Severity: Minor
                                                                  Found in api/src/controllers/representants-legaux.js and 1 other location - About 40 mins to fix
                                                                  api/src/controllers/representants-legaux.js on lines 90..111

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 304.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                          nodes: [
                                                                            {
                                                                              __typename: "Dossier",
                                                                              id: "dossierId",
                                                                              number: 1000,
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/fixtures/cle/appelAProjet.ts and 1 other location - About 4 days to fix
                                                                  api/src/providers/demarcheSimplifiee/demarcheSimplifieeProvider.test.ts on lines 97..365

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 972.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                          nodes: [
                                                                            {
                                                                              __typename: "Dossier",
                                                                              id: "dossierId",
                                                                              number: 1000,
                                                                  api/src/__tests__/fixtures/cle/appelAProjet.ts on lines 16..284

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 972.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("POST /young/forgot_password_reset", () => {
                                                                      it("should return return 400 when missing token or password", async () => {
                                                                        res = await request(getAppHelper()).post("/young/forgot_password_reset").send({ token: "foo" });
                                                                        expect(res.status).toBe(400);
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/young-auth.test.ts and 1 other location - About 3 days to fix
                                                                  api/src/__tests__/referent-auth.test.ts on lines 256..316

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 903.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("POST /referent/forgot_password_reset", () => {
                                                                      it("should return return 400 when missing token or password", async () => {
                                                                        res = await request(getAppHelper()).post("/referent/forgot_password_reset").send({ token: "foo" });
                                                                        expect(res.status).toBe(400);
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/referent-auth.test.ts and 1 other location - About 3 days to fix
                                                                  api/src/__tests__/young-auth.test.ts on lines 295..355

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 903.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("POST /young/reset_password", () => {
                                                                      it("should return return 400 when missing password", async () => {
                                                                        res = await request(getAppHelper()).post("/young/reset_password");
                                                                        expect(res.status).toBe(400);
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/young-auth.test.ts and 1 other location - About 3 days to fix
                                                                  api/src/__tests__/referent-auth.test.ts on lines 176..237

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 894.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("POST /referent/reset_password", () => {
                                                                      it("should return return 400 when missing password", async () => {
                                                                        res = await request(getAppHelper()).post("/referent/reset_password");
                                                                        expect(res.status).toBe(400);
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/referent-auth.test.ts and 1 other location - About 3 days to fix
                                                                  api/src/__tests__/young-auth.test.ts on lines 215..276

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 894.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("GET /toRegion/:cohort/:region", () => {
                                                                      it("should return 200 and data when request is valid and user can view tableDeRepartition", async () => {
                                                                        // Define a mock table de répartition object
                                                                        const mockTableDeRepartition = {
                                                                          _id: "mockId",
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/table-de-repartition.test.ts and 1 other location - About 1 day to fix
                                                                  api/src/__tests__/table-de-repartition.test.ts on lines 270..343

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 471.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("GET /fromRegion/:cohort/:region", () => {
                                                                      it("should return 200 and data when request is valid and user can view tableDeRepartition", async () => {
                                                                        // Define a mock table de répartition object
                                                                        const mockTableDeRepartition = {
                                                                          _id: "mockId",
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/table-de-repartition.test.ts and 1 other location - About 1 day to fix
                                                                  api/src/__tests__/table-de-repartition.test.ts on lines 196..269

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 471.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  const PHONE_ZONES = {
                                                                    FRANCE: {
                                                                      shortcut: "FR",
                                                                      name: "France métropolitaine",
                                                                      code: "+33",
                                                                  Severity: Major
                                                                  Found in packages/lib/src/phone-number.ts and 1 other location - About 1 day to fix
                                                                  packages/ds/src/common/constants/PhoneZones.ts on lines 3..116

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 471.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  const PhoneZones: Record<string, TPhoneZone> = {
                                                                    FRANCE: {
                                                                      shortcut: "FR",
                                                                      name: "France métropolitaine",
                                                                      code: "+33",
                                                                  Severity: Major
                                                                  Found in packages/ds/src/common/constants/PhoneZones.ts and 1 other location - About 1 day to fix
                                                                  packages/lib/src/phone-number.ts on lines 17..122

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 471.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("GET /structure/:id/patches", () => {
                                                                      it("should return 404 if structure not found", async () => {
                                                                        const res = await request(getAppHelper()).get(`/structure/${notExistingStructureId}/patches`).send();
                                                                        expect(res.statusCode).toEqual(404);
                                                                      });
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/structure.test.ts and 1 other location - About 7 hrs to fix
                                                                  api/src/__tests__/mission.test.ts on lines 185..214

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 436.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    describe("GET /mission/:id/patches", () => {
                                                                      it("should return 404 if mission not found", async () => {
                                                                        const res = await request(getAppHelper()).get(`/mission/${notExisitingMissionId}/patches`).send();
                                                                        expect(res.statusCode).toEqual(404);
                                                                      });
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/mission.test.ts and 1 other location - About 7 hrs to fix
                                                                  api/src/__tests__/structure.test.ts on lines 118..147

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 436.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    it("should update classe.status to OPEN if type === CLE && inscriptionStartDate", async () => {
                                                                      // @ts-ignore
                                                                      const previous = passport.user.subRole;
                                                                      // @ts-ignore
                                                                      passport.user.subRole = "god";
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/cohort.test.ts and 1 other location - About 6 hrs to fix
                                                                  api/src/__tests__/cohort.test.ts on lines 133..161

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 418.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    it("should update classe.status to Close if type === CLE && inscriptionEndDate", async () => {
                                                                      // @ts-ignore
                                                                      const previous = passport.user.subRole;
                                                                      // @ts-ignore
                                                                      passport.user.subRole = "god";
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/cohort.test.ts and 1 other location - About 6 hrs to fix
                                                                  api/src/__tests__/cohort.test.ts on lines 104..131

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 418.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.post("/send-invitation-referent-classe-verifiee", passport.authenticate("referent", { session: false, failWithError: true }), async (req: UserRequest, res: Response) => {
                                                                    try {
                                                                      logger.debug("Controller - send-invitation-referent-classe-verifiee");
                                                                  
                                                                      if (!isSuperAdmin(req.user)) {
                                                                  Severity: Major
                                                                  Found in api/src/cle/referent/referentController.ts and 1 other location - About 3 hrs to fix
                                                                  api/src/cle/referent/referentController.ts on lines 131..157

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 355.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                  router.post("/delete-old-referent-classe", passport.authenticate("referent", { session: false, failWithError: true }), async (req: UserRequest, res: Response) => {
                                                                    try {
                                                                      logger.debug("Controller - send-invitation-referent-classe");
                                                                  
                                                                      if (!isSuperAdmin(req.user)) {
                                                                  Severity: Major
                                                                  Found in api/src/cle/referent/referentController.ts and 1 other location - About 3 hrs to fix
                                                                  api/src/cle/referent/referentController.ts on lines 103..129

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 355.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    it("should transition class to STATUS_CLASSE.OPEN when inscription open", async () => {
                                                                      const patchedClasse = {
                                                                        ...mockedClasse,
                                                                        status: STATUS_CLASSE.ASSIGNED,
                                                                      };
                                                                  Severity: Major
                                                                  Found in api/src/cle/classe/classeService.test.ts and 1 other location - About 1 hr to fix
                                                                  api/src/cle/classe/classeService.test.ts on lines 569..596

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 325.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    it("should transition class to STATUS_CLASSE.CLOSED when inscription close", async () => {
                                                                      const patchedClasse = {
                                                                        ...mockedClasse,
                                                                        status: STATUS_CLASSE.OPEN,
                                                                      };
                                                                  Severity: Major
                                                                  Found in api/src/cle/classe/classeService.test.ts and 1 other location - About 1 hr to fix
                                                                  api/src/cle/classe/classeService.test.ts on lines 540..567

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 325.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    it("should update the youngs consent (false) and return 200", async () => {
                                                                      const userId = "123";
                                                                      const etablissement = await createEtablissement(createFixtureEtablissement());
                                                                      const classe = await createClasse(createFixtureClasse({ etablissementId: etablissement._id, referentClasseIds: [userId] }));
                                                                      const young = await createYoungHelper(getNewYoungFixture({ status: YOUNG_STATUS.IN_PROGRESS, inscriptionStep2023: "WAITING_CONSENT", source: "CLE", classeId: classe._id }));
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/young-edition.test.ts and 1 other location - About 1 hr to fix
                                                                  api/src/__tests__/young-edition.test.ts on lines 174..191

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 322.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  New

                                                                    it("should update the youngs imageRights (true) and return 200", async () => {
                                                                      const userId = "123";
                                                                      const etablissement = await createEtablissement(createFixtureEtablissement());
                                                                      const classe = await createClasse(createFixtureClasse({ etablissementId: etablissement._id, referentClasseIds: [userId] }));
                                                                      const young = await createYoungHelper(getNewYoungFixture({ status: YOUNG_STATUS.IN_PROGRESS, inscriptionStep2023: "WAITING_CONSENT", source: "CLE", classeId: classe._id }));
                                                                  Severity: Major
                                                                  Found in api/src/__tests__/young-edition.test.ts and 1 other location - About 1 hr to fix
                                                                  api/src/__tests__/young-edition.test.ts on lines 155..172

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 322.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 3 other locations - About 1 day to fix
                                                                  app/src/scenes/contract/index.jsx on lines 376..459
                                                                  app/src/scenes/contract/index.jsx on lines 835..918
                                                                  admin/src/components/Contract.jsx on lines 1397..1482

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 519.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 3 other locations - About 1 day to fix
                                                                  app/src/scenes/contract/index.jsx on lines 376..459
                                                                  app/src/scenes/contract/index.jsx on lines 835..918
                                                                  admin/src/components/Contract.jsx on lines 665..755

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 519.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/selectStatusApplication.jsx and 1 other location - About 1 day to fix
                                                                  admin/src/scenes/volontaires/view/phase2bis/components/SelectStatusApplicationPhase2.jsx on lines 92..111

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 390.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/footer.jsx and 1 other location - About 7 hrs to fix
                                                                  app/src/components/footer.jsx on lines 37..73

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 289.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 7 hrs to fix
                                                                  app/src/utils/generate-assets-presentation-page.js on lines 33..58

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 286.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/young/documents.js and 1 other location - About 6 hrs to fix
                                                                  api/src/controllers/SNUpport.js on lines 416..436

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 278.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/SNUpport.js and 1 other location - About 6 hrs to fix
                                                                  api/src/controllers/young/documents.js on lines 118..138

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 278.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 6 hrs to fix
                                                                  app/src/utils/generate-assets-presentation-page.js on lines 139..157

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 264.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 1 day to fix
                                                                  admin/src/components/Contract.jsx on lines 1337..1395

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 520.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 1 day to fix
                                                                  admin/src/components/Contract.jsx on lines 605..663

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 520.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/FileUpload.jsx and 1 other location - About 5 hrs to fix
                                                                  app/src/components/FileUpload.jsx on lines 79..109

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 250.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/services/api.js and 1 other location - About 5 hrs to fix
                                                                  app/src/services/api.js on lines 130..163

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 250.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/program.js and 1 other location - About 4 hrs to fix
                                                                  api/src/controllers/program.js on lines 107..121

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 228.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/program.js and 1 other location - About 4 hrs to fix
                                                                  api/src/controllers/program.js on lines 46..60

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 228.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/selectStatusMission.jsx and 1 other location - About 4 hrs to fix
                                                                  admin/src/scenes/missions/components/SelectStatusMissionV2.jsx on lines 34..61

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 223.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/utils/pagination.utils.js and 1 other location - About 4 hrs to fix
                                                                  app/src/utils/pagination.utils.js on lines 1..14

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 220.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/IconDomain.jsx and 1 other location - About 7 hrs to fix
                                                                  admin/src/components/IconDomainRounded.jsx on lines 14..59

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/IconDomainRounded.jsx and 1 other location - About 7 hrs to fix
                                                                  admin/src/components/IconDomain.jsx on lines 14..59

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/application.js and 1 other location - About 7 hrs to fix
                                                                  api/src/controllers/application.js on lines 542..559

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/application.js and 1 other location - About 7 hrs to fix
                                                                  api/src/controllers/application.js on lines 345..362

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 431.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 3 hrs to fix
                                                                  api/src/auth.js on lines 333..350

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 202.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 3 hrs to fix
                                                                  api/src/auth.js on lines 183..200

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 202.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 5 hrs to fix
                                                                  admin/src/components/Contract.jsx on lines 1486..1530

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 393.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/Contract.jsx and 1 other location - About 5 hrs to fix
                                                                  admin/src/components/Contract.jsx on lines 759..803

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 393.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/utils/index.jsx and 1 other location - About 2 hrs to fix
                                                                  app/src/utils/index.js on lines 124..140

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 184.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 2 hrs to fix
                                                                  api/src/auth.js on lines 243..247

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 183.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/auth.js and 1 other location - About 2 hrs to fix
                                                                  api/src/auth.js on lines 102..106

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 183.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/selectStatusMission.jsx and 1 other location - About 1 hr to fix
                                                                  admin/src/scenes/missions/components/SelectStatusMissionV2.jsx on lines 69..80

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 171.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in admin/src/components/FileUpload.jsx and 1 other location - About 2 hrs to fix
                                                                  app/src/components/FileUpload.jsx on lines 42..74

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 336.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/young/phase1.js and 1 other location - About 1 hr to fix
                                                                  api/src/controllers/young/index.js on lines 1060..1070

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 163.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/young/index.js and 1 other location - About 1 hr to fix
                                                                  api/src/controllers/young/phase1.js on lines 336..346

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 163.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Minor
                                                                  Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 55 mins to fix
                                                                  app/src/utils/generate-assets-presentation-page.js on lines 71..81

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 159.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Major
                                                                  Found in api/src/controllers/bus.js and 1 other location - About 1 hr to fix
                                                                  api/src/controllers/dashboard/alerte-message.js on lines 24..41

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 311.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Minor
                                                                  Found in api/src/controllers/representants-legaux.js and 1 other location - About 40 mins to fix
                                                                  api/src/controllers/representants-legaux.js on lines 361..382

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 304.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                  Fixed

                                                                  Severity: Minor
                                                                  Found in api/src/controllers/representants-legaux.js and 1 other location - About 40 mins to fix
                                                                  api/src/controllers/representants-legaux.js on lines 90..111

                                                                  Duplicated Code

                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                  Tuning

                                                                  This issue has a mass of 304.

                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                  Refactorings

                                                                  Further Reading

                                                                  There are no issues that match your filters.

                                                                  Category
                                                                  Status
                                                                  FileMaintainabilityTest Coverage
                                                                  admin/src/components/filters-system-v2/components/Filter.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/config.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/hooks/useEnvironment.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/redux/auth/actions.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/redux/auth/reducer.ts
                                                                  A
                                                                  25 mins
                                                                  admin/src/redux/cohorts/actions.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/redux/cohorts/reducer.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/redux/reducers.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/redux/tickets/actions.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/redux/tickets/reducer.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/scenes/classe/components/types.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/scenes/classe/utils/index.ts
                                                                  A
                                                                  1 hr
                                                                  admin/src/scenes/etablissement/Create/type.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/scenes/etablissement/utils/index.ts
                                                                  A
                                                                  2 hrs
                                                                  admin/src/scenes/plan-transport/ligne-bus/import/type.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/scenes/plan-transport/schema-repartition/components/types.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/scenes/plan-transport/schema-repartition/utils/index.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/scenes/volontaire-cle/utils/list.ts
                                                                  B
                                                                  4 hrs
                                                                  admin/src/services/classeService.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/services/cle.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/services/cohort.service.ts
                                                                  A
                                                                  25 mins
                                                                  admin/src/types.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/utils/buildRequest.ts
                                                                  A
                                                                  0 mins
                                                                  admin/src/utils/session.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/__mocks__/passport.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/__mocks__/redis.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/alerte-message.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/application.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/bus.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/appelAProjet.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/classe.test.ts
                                                                  B
                                                                  6 hrs
                                                                  api/src/__tests__/cle/classeImport.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/classes.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/etablissement.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/referent-signup.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/referent.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cle/young.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cohesion-center.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/cohort.test.ts
                                                                  C
                                                                  1 day
                                                                  api/src/__tests__/contract.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/correction-request.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/department-service.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/diagoriente.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/email.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/PlanDeTransport/importPlanTransport.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/PlanDeTransport/ligneBus.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/PlanDeTransport/ligneToPoint.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/PlanDeTransport/pointDeRassemblement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/alerteMessage.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/application.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/bus.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/busTeam.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/classe.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/cle/appelAProjet.ts
                                                                  F
                                                                  4 days
                                                                  api/src/__tests__/fixtures/cle/schoolRamses.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/cohesionCenter.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/cohort.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/contract.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/departmentService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/etablissement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/inscriptionGoal.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/meetingPoint.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/mission.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/program.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/providers/annuaireEtablissement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/referent.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/sessionPhase1.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/structure.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/fixtures/young.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/PlanDeTransport/planDeTransport.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/__tests__/helpers/PlanDeTransport/pointDeRassemblement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/app.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/application.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/bus.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/classe.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/cohesionCenter.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/cohort.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/contract.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/db.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/departmentService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/es.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/etablissement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/inscriptionGoal.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/meetingPoint.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/mission.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/program.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/referent.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/sessionPhase1.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/structure.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/helpers/young.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/infra/accessControl.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/infra/fakeEndpoint.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/inscription-goal.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/ligne-de-bus.test.ts
                                                                  A
                                                                  3 hrs
                                                                  api/src/__tests__/ligne-to-point.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/mission.test.ts
                                                                  C
                                                                  7 hrs
                                                                  api/src/__tests__/plan-de-transport.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/point-de-rassemblement.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/program.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/referent-auth.test.ts
                                                                  F
                                                                  1 wk
                                                                  api/src/__tests__/referent.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/session-phase1.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/sessionPhase1/getPlanDeTransport.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/structure.test.ts
                                                                  C
                                                                  7 hrs
                                                                  api/src/__tests__/table-de-repartition.test.ts
                                                                  D
                                                                  2 days
                                                                  api/src/__tests__/waiting-list.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/young-auth.test.ts
                                                                  F
                                                                  1 wk
                                                                  api/src/__tests__/young-documents.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/young-edition.test.ts
                                                                  A
                                                                  3 hrs
                                                                  api/src/__tests__/young-inscription.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/young-meeting-point.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/young-node.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/__tests__/young.test.ts
                                                                  A
                                                                  2 hrs
                                                                  api/src/brevo.ts
                                                                  B
                                                                  5 hrs
                                                                  api/src/cle/appelAProjetCle/appelAProjetClasseService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/appelAProjetCle/appelAProjetController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/appelAProjetCle/appelAProjetEtablissementService.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/cle/appelAProjetCle/appelAProjetReferentService.ts
                                                                  A
                                                                  3 hrs
                                                                  api/src/cle/appelAProjetCle/appelAProjetService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/appelAProjetCle/appelAProjetService.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/cle/appelAProjetCle/appelAProjetType.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/classeController.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/cle/classe/classeService.test.ts
                                                                  A
                                                                  3 hrs
                                                                  api/src/cle/classe/classeService.ts
                                                                  A
                                                                  25 mins
                                                                  api/src/cle/classe/classeValidator.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/export/classeExportService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/import/classeCohortImport.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/import/classeCohortMapper.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/import/classeImportController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/import/classeImportService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/import/classeImportService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classe/stateManager.ts
                                                                  A
                                                                  55 mins
                                                                  api/src/cle/classes/classesController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classes/classesService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/classes/classesService.ts
                                                                  A
                                                                  35 mins
                                                                  api/src/cle/classes/classesValidator.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/etablissement/etablissementController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/etablissement/etablissementMapper.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/index.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/referent/referentController.ts
                                                                  B
                                                                  6 hrs
                                                                  api/src/cle/referent/referentRepository.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/referent/referentSignupController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cle/young/youngController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cohort/cohortController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cohort/cohortService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cohort/cohortService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cohort/cohortValidator.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/controllers/correction-request.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/controllers/request.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/controllers/session-phase1.ts
                                                                  A
                                                                  2 hrs
                                                                  api/src/controllers/young/note.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/crons/__tester__.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/crons/classesStatusUpdate.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/cryptoUtils.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/emails/cle/classe.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/featureFlag/featureFlagService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/featureFlag/featureFlagService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/geo.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/logger.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/mailcatcher.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/middlewares/accessControlMiddleware.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/middlewares/accessControlMiddleware.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/middlewares/authMiddleware.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/middlewares/authMiddleware.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/middlewares/requestValidatorMiddleware.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/middlewares/requestValidatorMiddleware.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/importPlanTransport.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/ligneBus.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/ligneToPoint.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/modificationBus.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/planTransport.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/pointDeRassemblement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/schemaDeRepartition.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/PlanDeTransport/tableDeRepartition.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/alerteMessage.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/application.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/areas.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/bus.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/cle/classe.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/cle/etablissement.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/cohesionCenter.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/cohort.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/contract.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/departmentService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/email.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/event.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/featureFlag.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/filters.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/index.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/inscriptionGoal.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/meetingPoint.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/mission.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/missionAPI.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/missionEquivalence.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/program.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/referent.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/school.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/schoolRAMSES.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/sessionPhase1.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/sessionPhase1Token.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/structure.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/tags.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/types.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/waitingList.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/models/young.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/pdt/import/pdtImportService.ts
                                                                  F
                                                                  5 days
                                                                  api/src/pdt/import/pdtImportUtils.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/preinscription/preinscriptionController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/providers/demarcheSimplifiee/demarcheSimplifieeDto.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/providers/demarcheSimplifiee/demarcheSimplifieeProvider.test.ts
                                                                  F
                                                                  4 days
                                                                  api/src/providers/demarcheSimplifiee/demarcheSimplifieeProvider.ts
                                                                  A
                                                                  25 mins
                                                                  api/src/providers/demarcheSimplifiee/demarcheSimplifieeQueryBuilder.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/providers/demarcheSimplifiee/demarcheSimplifieeQueryBuilder.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/queues/cronsQueue.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/queues/redisQueue.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/queues/sendMailQueue.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/queues/taskLoggerService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/referent/referentController.ts
                                                                  D
                                                                  2 days
                                                                  api/src/routes.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/cle/referent.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/services/fileService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/fileService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/gouv.fr/api-education.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/gouv.fr/api-education.ts
                                                                  A
                                                                  25 mins
                                                                  api/src/services/gouv.fr/etablissementType.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/inscription-goal.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/inscription-goal.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/services/regionService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/sessionPhase1/sessionPhase1Controller.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/templates/certificate/phase1.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/templates/consent/consent.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/templates/convocation/cohesion.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/templates/droitImage/droitImage.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/templates/templateService.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/templates/utils.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/utils/file.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/utils/pdf-renderer.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/utils/validator.ts
                                                                  C
                                                                  7 hrs
                                                                  api/src/young/edition/youngEditionController.ts
                                                                  A
                                                                  1 hr
                                                                  api/src/young/edition/youngEditionService.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/young/email/youngEmailController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/young/email/youngEmailService.ts
                                                                  A
                                                                  55 mins
                                                                  api/src/young/youngCertificateService.ts
                                                                  A
                                                                  55 mins
                                                                  api/src/young/youngController.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/young/youngDocument.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/young/youngSendDocumentEmailService.ts
                                                                  A
                                                                  45 mins
                                                                  api/src/young/youngService.test.ts
                                                                  A
                                                                  0 mins
                                                                  api/src/young/youngService.ts
                                                                  A
                                                                  45 mins
                                                                  app/src/scenes/preinscription/components/Modals.ts
                                                                  A
                                                                  0 mins
                                                                  app/src/scenes/preinscription/preinscription.repository.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/admin/form/Select/theme.ts
                                                                  B
                                                                  4 hrs
                                                                  packages/ds/src/admin/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/app/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/common/constants/PhoneZones.ts
                                                                  C
                                                                  1 day
                                                                  packages/ds/src/common/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/dsfr/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/postcss.config.ts
                                                                  A
                                                                  0 mins
                                                                  packages/ds/src/tailwind.config.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/SNUpport.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/cohort/cohortService.spec.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/cohort/cohortService.ts
                                                                  A
                                                                  50 mins
                                                                  packages/lib/src/cohort/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/common.ts
                                                                  B
                                                                  4 hrs
                                                                  packages/lib/src/constants/academy.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/cle/classeConstants.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/cohort.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/colors.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/constants.ts
                                                                  B
                                                                  5 hrs
                                                                  packages/lib/src/constants/email.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/errors.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/featureFlags.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/functionalErrors.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/plan-de-transport.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/referentConstants.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/constants/todo.constants.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/alerteMessageDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/classeDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/cohortDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/contractDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/etablissementDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/referentDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/userDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/dto/youngDto.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/excelExports.ts
                                                                  C
                                                                  1 day
                                                                  packages/lib/src/features.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/hooks/useAddress.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/cle/classe.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/cle/etablissement.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/cohesionCenter.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/cohort.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/pointDeRassemblement.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/referent.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/sessionPhase1.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/mongoSchema/young.ts
                                                                  F
                                                                  4 days
                                                                  packages/lib/src/phone-number.ts
                                                                  C
                                                                  1 day
                                                                  packages/lib/src/plandetransport/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/plandetransport/ligneService.spec.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/plandetransport/ligneService.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/region-and-departments.ts
                                                                  A
                                                                  3 hrs
                                                                  packages/lib/src/roles.ts
                                                                  D
                                                                  2 days
                                                                  packages/lib/src/routes/cle/classe/create.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/cle/classe/delete.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/cle/classe/getOne.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/cle/classe/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/cle/classe/update.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/cohort/get.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/cohort/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/routes/index.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/sessions.spec.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/sessions.ts
                                                                  A
                                                                  2 hrs
                                                                  packages/lib/src/translation.ts
                                                                  D
                                                                  2 days
                                                                  packages/lib/src/transport-info.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/utils/cohortUtils.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/utils/date.spec.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/utils/date.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/utils/file.ts
                                                                  A
                                                                  0 mins
                                                                  packages/lib/src/utils/request.ts
                                                                  A
                                                                  55 mins
                                                                  packages/lib/src/young.ts
                                                                  A
                                                                  0 mins
                                                                  api/.eslintrc.js
                                                                  A
                                                                  packages/lib/.eslintrc.js
                                                                  A