tutorbookapp/tutorbook

View on GitHub

Showing 507 of 518 total issues

Avoid too many return statements within this function.
Open

  if (typeof json.reference !== '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 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 localeConfig.bio !== 'string') return false;
      Severity: Major
      Found in lib/model/org.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          if (json.recur && typeof json.recur !== 'string') 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 (!isHomeConfig(json.home)) return false;
          Severity: Major
          Found in lib/model/org.ts - About 30 mins to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                    onBlur={() => {
                      if (onBlurred) onBlurred();
                      timeoutId.current = setTimeout(() => setMenuOpen(false), 0);
                    }}
            Severity: Minor
            Found in components/availability-select/index.tsx and 1 other location - About 30 mins to fix
            components/time-select/index.tsx on lines 115..118

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 45.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Avoid too many return statements within this function.
            Open

              if (!isStringArray(json.profiles)) return false;
            Severity: Major
            Found in lib/model/org.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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        <Link href={href}>
                          <a className={styles.itemLink}>{children}</a>
                        </Link>
                Severity: Minor
                Found in components/navigation/pop-over.tsx and 1 other location - About 30 mins to fix
                components/button/index.tsx on lines 55..57

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                      const [err] = await to<
                        AxiosResponse<MeetingJSON>,
                        AxiosError<APIErrorJSON>
                      >(axios.post('/api/meetings', meeting.toJSON()));
                Severity: Minor
                Found in components/user/request-form.tsx and 1 other location - About 30 mins to fix
                components/user/request-form.tsx on lines 99..102

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Avoid too many return statements within this function.
                Open

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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    const { data, error } = await supabase
                      .from<DBUser>('users')
                      .update({ ...user.toDB(), times: await times(user) })
                  Severity: Minor
                  Found in lib/api/db/user.ts and 1 other location - About 30 mins to fix
                  lib/api/db/user.ts on lines 32..34

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        <Link href={href}>
                          <a className={styles.link}>{button}</a>
                        </Link>
                    Severity: Minor
                    Found in components/button/index.tsx and 1 other location - About 30 mins to fix
                    components/navigation/pop-over.tsx on lines 39..41

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 45.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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
                                Severity
                                Category
                                Status
                                Source
                                Language