ahbeng/NUSMods

View on GitHub

Showing 538 of 538 total issues

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

    const noInfoModulesWithExams = Array.from(
      difference(new Set(Object.keys(exams)), new Set(Object.keys(modulesMap))),
    );
Severity: Minor
Found in scrapers/nus-v2/src/tasks/GetSemesterData.ts and 1 other location - About 35 mins to fix
scrapers/nus-v2/src/tasks/GetSemesterData.ts on lines 329..331

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

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

  (
    methodHandlers: MethodHandlers,
    fallback: (mh: MethodHandlers) => Handler,
    rescue: (err: Error) => Handler,
  ): Handler =>
Severity: Minor
Found in website/src/serverless/handler.ts and 1 other location - About 35 mins to fix
website/src/types/modules.ts on lines 75..82

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

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

      <ExternalLink className={styles.github} href={config.contact.githubRepo}>
        <GitHub />
        GitHub
      </ExternalLink>
Severity: Minor
Found in website/src/views/components/FeedbackModal.tsx and 1 other location - About 35 mins to fix
website/src/views/components/FeedbackModal.tsx on lines 21..24

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

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 connectedSettings = connect(mapStateToProps, {
  selectTheme,
  selectFaculty,
  selectMode,
  toggleBetaTesting,
Severity: Minor
Found in website/src/views/settings/SettingsContainer.tsx and 1 other location - About 35 mins to fix
scrapers/nus-v2/src/tasks/GetSemesterTimetable.ts on lines 117..117

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

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

    if (noInfoModulesWithExams.length > 0) {
      this.logger.debug(
        { moduleCodes: noInfoModulesWithExams.sort() },
        'Found modules with exam but no info',
      );
Severity: Minor
Found in scrapers/nus-v2/src/tasks/GetSemesterData.ts and 1 other location - About 35 mins to fix
scrapers/nus-v2/src/tasks/GetSemesterData.ts on lines 332..337

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

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 noInfoModulesWithTimetables = Array.from(
      difference(new Set(Object.keys(timetables)), new Set(Object.keys(modulesMap))),
    );
Severity: Minor
Found in scrapers/nus-v2/src/tasks/GetSemesterData.ts and 1 other location - About 35 mins to fix
scrapers/nus-v2/src/tasks/GetSemesterData.ts on lines 340..342

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

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

    if (noInfoModulesWithTimetables.length > 0) {
      this.logger.debug(
        { moduleCodes: noInfoModulesWithTimetables.sort() },
        'Found modules with timetable but no info',
      );
Severity: Minor
Found in scrapers/nus-v2/src/tasks/GetSemesterData.ts and 1 other location - About 35 mins to fix
scrapers/nus-v2/src/tasks/GetSemesterData.ts on lines 343..348

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

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

      mergeAliases([
        {
          GES1001: s('GEK2041'),
          GET1025: s('GES1001'),
        },
Severity: Minor
Found in scrapers/nus-v2/src/tasks/CollateModules.test.ts and 1 other location - About 35 mins to fix
scrapers/nus-v2/src/tasks/CollateModules.test.ts on lines 206..215

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

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;
Severity: Major
Found in scrapers/nus-v2/src/services/requisite-tree/parseString.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return <LoadingSpinner />;
    Severity: Major
    Found in website/src/views/modules/ModuleArchiveContainer.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return cleanedDesc.includes('light') ? Showers : Rain;
      Severity: Major
      Found in website/src/views/components/icons/weather.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return undefined;
        Severity: Major
        Found in packages/browserslist-config-nusmods/scripts/helpers.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            if (process.env.NODE_ENV === 'production' && process.env.CI) return 'preview';
          Severity: Major
          Found in website/webpack/webpack.parts.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return 'development';
            Severity: Major
            Found in website/webpack/webpack.parts.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return latestVersion;
              Severity: Major
              Found in packages/browserslist-config-nusmods/scripts/helpers.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  if (acadWeekNumber <= lastWeekOfSpecialSem2) return special2;
                Severity: Major
                Found in packages/nusmoderator/src/academicCalendar.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return null;
                  Severity: Major
                  Found in packages/nusmoderator/src/academicCalendar.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return <LoadingSpinner />;
                    Severity: Major
                    Found in website/src/views/modules/ModulePageContainer.tsx - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return Thunderstorm;
                      Severity: Major
                      Found in website/src/views/components/icons/weather.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return null;
                        Severity: Major
                        Found in website/src/views/components/icons/weather.ts - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language