betagouv/service-national-universel

View on GitHub
api/src/controllers/session-phase1.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Avoid deeply nested control flow statements.
Open

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

                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

      Avoid deeply nested control flow statements.
      Open

                  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

        There are no issues that match your filters.

        Category
        Status