cityssm/lottery-licence-manager

View on GitHub

Showing 28 of 460 total issues

Avoid too many return statements within this function.
Open

  return reminderTypeOrdering[reminderA.reminderTypeKey] - reminderTypeOrdering[reminderB.reminderTypeKey];
Severity: Major
Found in helpers/licencesDB/getOrganizationReminders.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return reminderB.dueDate - reminderA.dismissedDate;
    Severity: Major
    Found in helpers/licencesDB/getOrganizationReminders.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return reminderTypeOrdering[reminderA.reminderTypeKey] - reminderTypeOrdering[reminderB.reminderTypeKey];
      Severity: Major
      Found in helpers/licencesDB/getOrganizationReminders.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return reminderB.dueDate - reminderA.dismissedDate;
        Severity: Major
        Found in helpers/licencesDB/getOrganizationReminders.ts - About 30 mins to fix

          Function updateEvent has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
          Open

          export const updateEvent = (requestBody, requestSession) => {
              const database = sqlite(databasePath);
              const nowMillis = Date.now();
              const info = database.prepare("update LotteryEvents" +
                  " set reportDate = ?," +
          Severity: Minor
          Found in helpers/licencesDB/updateEvent.js - 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 getEvents has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
          Open

          export const getEvents = (requestBody: {
            externalLicenceNumber?: string;
            licenceTypeKey?: string;
            organizationName?: string;
            locationName?: string;
          Severity: Minor
          Found in helpers/licencesDB/getEvents.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 getEvents has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
          Open

          export const getEvents = (requestBody, requestSession, options) => {
              const database = sqlite(databasePath, {
                  readonly: true
              });
              const sqlParameters = [];
          Severity: Minor
          Found in helpers/licencesDB/getEvents.js - 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 updateEvent has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
          Open

          export const updateEvent = (requestBody: UpdateEventForm, requestSession: expressSession.Session): boolean => {
          
            const database = sqlite(databasePath);
          
            const nowMillis = Date.now();
          Severity: Minor
          Found in helpers/licencesDB/updateEvent.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

          Severity
          Category
          Status
          Source
          Language