tutorbookapp/tutorbook

View on GitHub

Showing 108 of 518 total issues

Avoid too many return statements within this function.
Open

      return avail;
Severity: Major
Found in components/availability-select/index.tsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      if (typeof json.org !== 'string') return false;
    Severity: Major
    Found in lib/model/meeting.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              if (student?.name) return student.name;
      Severity: Major
      Found in components/calendar/meetings/content.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return localStorage.removeItem('email');
        Severity: Major
        Found in pages/confirm.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return 0;
          Severity: Major
          Found in components/calendar/place-meetings.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    if (subjects) return subjects;
            Severity: Major
            Found in components/calendar/meetings/content.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                if (!isArray(json.subjects, isSubject)) return false;
              Severity: Major
              Found in lib/model/user.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  if (json.last && !isDateJSON(json.last)) return false;
                Severity: Major
                Found in lib/model/timeslot.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    if (json.hash && typeof json.hash !== 'string') return false;
                  Severity: Major
                  Found in lib/model/user.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return true;
                    Severity: Major
                    Found in lib/model/meeting.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        if (json.exdates && !isArray(json.exdates, isDateJSON)) return false;
                      Severity: Major
                      Found in lib/model/timeslot.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return true;
                        Severity: Major
                        Found in lib/model/account.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            if (!isAvailabilityJSON(json.availability)) return false;
                          Severity: Major
                          Found in lib/model/user.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              if (!isArray(json.tags, isUserTag)) return false;
                            Severity: Major
                            Found in lib/model/user.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                if (!isArray(json.people, isUserJSON)) return false;
                              Severity: Major
                              Found in lib/model/meeting.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return true;
                                Severity: Major
                                Found in lib/model/timeslot.ts - About 30 mins to fix

                                  Function Card has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function Card<T extends Record<string, number> & { week: number }>({
                                    data,
                                    title,
                                    children,
                                    header,
                                  Severity: Minor
                                  Found in components/analytics/index.tsx - 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 DialogContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default function DialogContent({
                                    page,
                                    children,
                                    forceMinHeight,
                                  }: DialogContentProps): JSX.Element {
                                  Severity: Minor
                                  Found in components/dialog/index.tsx - 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 getMeetingVenue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default function getMeetingVenue(
                                    meeting: Meeting,
                                    org: Org,
                                    people: User[]
                                  ): string {
                                  Severity: Minor
                                  Found in lib/api/get/meeting-venue.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 getPerson has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default async function getPerson(
                                    { id, roles, name }: Partial<User> & { id: string },
                                    people: User[] = []
                                  ): Promise<User> {
                                    if (!id) {
                                  Severity: Minor
                                  Found in lib/api/get/person.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