tutorbookapp/tutorbook

View on GitHub

Showing 108 of 518 total issues

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this function.
    Open

      if (typeof json.description !== '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

          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 (json.token && typeof json.token !== '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

              if (!isUserJSON(json.creator)) 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 (!isTimeslotJSON(json.time)) 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 0;
                Severity: Major
                Found in components/calendar/place-meetings.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return timeslots;
                  Severity: Major
                  Found in lib/utils/time.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return true;
                    Severity: Major
                    Found in lib/model/org.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 localStorage.removeItem('email');
                        Severity: Major
                        Found in pages/confirm.tsx - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            if (!isStringArray(json.parents)) 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 (typeof json.visible !== 'boolean') 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.roles, isRole)) 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 (typeof json.org !== 'string') return false;
                                Severity: Major
                                Found in lib/model/meeting.ts - About 30 mins to fix

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

                                  export default function PhotoInput({
                                    value,
                                    onChange,
                                    required,
                                    ...textFieldProps
                                  Severity: Minor
                                  Found in components/photo-input/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 getRecurString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function getRecurString(rrule?: string, locale = 'en'): string {
                                    let recur = '';
                                    if (!rrule) return recur;
                                    if (rrule.includes('FREQ=DAILY')) {
                                      recur = 'Daily';
                                  Severity: Minor
                                  Found in lib/utils/index.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 updateAuthUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default async function updateAuthUser(user: User): Promise<User> {
                                    await user.validatePhone();
                                    const [err, userRecord] = await to<UserRecord, FirebaseError>(
                                      auth.updateUser(user.id, {
                                        disabled: false,
                                  Severity: Minor
                                  Found in lib/api/update/auth-user.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 UserDisplayPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function UserDisplayPage({
                                    org,
                                    user: fallbackData,
                                    langs: initialLangs,
                                    subjects: initialSubjects,
                                  Severity: Minor
                                  Found in pages/[org]/users/[id]/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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language