betagouv/service-national-universel

View on GitHub
api/src/services/jeveuxaider.js

Summary

Maintainability
A
2 hrs
Test Coverage

Avoid deeply nested control flow statements.
Open

            if (young.statusPhase2 === YOUNG_STATUS_PHASE2.IN_PROGRESS && application.status === APPLICATION_STATUS.VALIDATED) data.actions.missionInProgress += 1;
Severity: Major
Found in api/src/services/jeveuxaider.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (contract && application.status === APPLICATION_STATUS.VALIDATED) {
                  const statusContract = checkStatusContract(contract);
                  if (statusContract === CONTRACT_STATUS.DRAFT) data.actions.contractToBeFilled += 1;
                  if (statusContract === CONTRACT_STATUS.SENT && contract.structureManagerStatus === "WAITING_VALIDATION") data.actions.contractToBeSigned += 1;
                  if (statusContract === CONTRACT_STATUS.VALIDATED && young.status === YOUNG_STATUS.VALIDATED) data.actions.volunteerToHost += 1;
    Severity: Major
    Found in api/src/services/jeveuxaider.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (application.status === APPLICATION_STATUS.WAITING_VALIDATION) data.actions.applicationWaitingValidation += 1;
      Severity: Major
      Found in api/src/services/jeveuxaider.js - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status