ahbeng/NUSMods

View on GitHub

Showing 538 of 538 total issues

Avoid too many return statements within this function.
Open

    return Wind;
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 state;
    Severity: Major
    Found in website/src/reducers/moduleBank.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return assertNever(conflict);
      Severity: Major
      Found in website/src/utils/planner.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return fulfilled.length >= requiredCount ? null : [fragment];
        Severity: Major
        Found in website/src/utils/planner.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return {
                  past: [...past, present],
                  present: next,
                  future: newFuture,
                };
          Severity: Major
          Found in website/src/reducers/undoHistory.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    lessons: { [semester]: timetable },
                    colors: { [semester]: colors },
                    hidden: { [semester]: hidden },
            Severity: Major
            Found in website/src/reducers/timetables.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return `Weeks ${processed.join(', ')}`;
              Severity: Major
              Found in website/src/utils/timetables.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return assertNever(fragment);
                Severity: Major
                Found in website/src/utils/planner.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return state;
                  Severity: Major
                  Found in website/src/reducers/undoHistory.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return produce(state, (draft) => {
                            draft.hidden[semester] = hiddenModules;
                          });
                    Severity: Major
                    Found in website/src/reducers/timetables.ts - About 30 mins to fix

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

                          const getState = jest.fn().mockReturnValue({
                            moduleBank: { modules: { CS1010S: {} } },
                          } as any);
                      Severity: Minor
                      Found in website/src/actions/moduleBank.test.ts and 1 other location - About 30 mins to fix
                      website/src/actions/moduleBank.test.ts on lines 28..30

                      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 defaultState: PlannerState = {
                        minYear: '2017/2018',
                        maxYear: '2018/2019',
                        iblocs: false,
                        ignorePrereqCheck: false,
                      Severity: Minor
                      Found in website/src/reducers/planner.test.ts and 1 other location - About 30 mins to fix
                      website/src/selectors/planner.test.ts on lines 15..22

                      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

                        expect(component.find(`.${styles.moduleWorkloadBlocks}`).children()).toHaveLength(12);
                      website/src/views/components/module-info/ModuleWorkload.test.tsx on lines 34..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

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

                      const defaultState: PlannerState = {
                        minYear: '2018/2019',
                        maxYear: '2018/2019',
                        iblocs: false,
                        ignorePrereqCheck: false,
                      Severity: Minor
                      Found in website/src/selectors/planner.test.ts and 1 other location - About 30 mins to fix
                      website/src/reducers/planner.test.ts on lines 20..27

                      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

                      describe(decodeHTMLEntities, () => {
                        test('should decode HTML entities', () => {
                          expect(
                            decodeHTMLEntities('& Schrödinger cried, "Oh là là!"'),
                          ).toEqual('& Schrödinger cried, "Oh là là!"');
                      Severity: Minor
                      Found in scrapers/nus-v2/src/utils/data.test.ts and 1 other location - About 30 mins to fix
                      website/src/utils/planner.test.ts on lines 53..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

                      describe(conflictToText, () => {
                        test('should describe single modules', () => {
                          expect(conflictToText('CS1010S')).toEqual('CS1010S');
                        });
                      });
                      Severity: Minor
                      Found in website/src/utils/planner.test.ts and 1 other location - About 30 mins to fix
                      scrapers/nus-v2/src/utils/data.test.ts on lines 39..45

                      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

                            {!!suggestion && (
                              <button type="button" className="btn btn-outline-primary" onClick={setSuggestionFn}>
                                {translate('NoHits.DidYouMean', { suggestion })}
                              </button>
                            )}
                      Severity: Minor
                      Found in website/src/views/errors/ModuleFinderNoHits.tsx and 1 other location - About 30 mins to fix
                      website/src/views/errors/ModuleFinderNoHits.tsx on lines 40..44

                      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

                        expect(component.find(`.${styles.moduleWorkloadBlocks}`).children()).toHaveLength(10);
                      website/src/views/components/module-info/ModuleWorkload.test.tsx on lines 53..53

                      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 getState = jest.fn().mockReturnValue({
                            moduleBank: { modules: { CS1010S: {} } },
                          } as any);
                      Severity: Minor
                      Found in website/src/actions/moduleBank.test.ts and 1 other location - About 30 mins to fix
                      website/src/actions/moduleBank.test.ts on lines 61..63

                      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

                            {filtersCount > 0 && (
                              <button type="button" className="btn btn-outline-primary" onClick={resetFiltersFn}>
                                {translate('NoHits.SearchWithoutFilters', { query })}
                              </button>
                            )}
                      Severity: Minor
                      Found in website/src/views/errors/ModuleFinderNoHits.tsx and 1 other location - About 30 mins to fix
                      website/src/views/errors/ModuleFinderNoHits.tsx on lines 35..39

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language