ahbeng/NUSMods

View on GitHub

Showing 538 of 538 total issues

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

            {
            this.state = 196;
            this.match(NusModsParser.COURSES);
            this.state = 198;
            this._errHandler.sync(this);
scrapers/nus-v2/src/services/requisite-tree/antlr4/NusModsParser.ts on lines 1001..1016

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

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

Function MpeContainer has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MpeContainer: React.FC = () => {
  const [isGettingSSOLink, setIsGettingSSOLink] = useState(false);
  const [isModalOpen, setIsModalOpen] = useState(false);
  const [isLoggedIn, setIsLoggedIn] = useState(getLoginState(useLocation(), useHistory()));

Severity: Major
Found in website/src/views/mpe/MpeContainer.tsx - About 4 hrs to fix

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

    function generateAndBranch(modules: PrereqTree[]) {
      const children: PrereqTree[] = R.uniq(modules);
      // Simplifying the expression
      if (children.length === 1) {
        return children[0];
    Severity: Major
    Found in scrapers/nus-v2/src/services/requisite-tree/parseString.ts and 1 other location - About 4 hrs to fix
    scrapers/nus-v2/src/services/requisite-tree/parseString.ts on lines 30..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 129.

    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

    function generateOrBranch(modules: PrereqTree[]) {
      const children: PrereqTree[] = R.uniq(modules);
      // Simplifying the expression:
      if (children.length === 1) {
        return children[0];
    Severity: Major
    Found in scrapers/nus-v2/src/services/requisite-tree/parseString.ts and 1 other location - About 4 hrs to fix
    scrapers/nus-v2/src/services/requisite-tree/parseString.ts on lines 13..28

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

    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

        it('should open modal and downshift when clicked', () => {
          const wrapper = shallow(<ModulesSelect {...commonProps} />);
          wrapper.find('button').simulate('click');
          const modal = wrapper.find(Modal);
          const downshift = wrapper.find(Downshift);
    Severity: Major
    Found in website/src/views/timetable/ModulesSelect.test.tsx and 1 other location - About 4 hrs to fix
    website/src/views/mpe/form/ModulesSelect.test.tsx on lines 69..76

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

    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

      test('show many results if the search only returns venues', () => {
        const { getByRole, getAllByRole } = make({
          venueBank: { venueList: range(100).map((n) => `Venue ${n}`) },
        });
    
    
    Severity: Major
    Found in website/src/views/layout/GlobalSearchContainer.test.tsx and 1 other location - About 4 hrs to fix
    website/src/views/layout/GlobalSearchContainer.test.tsx on lines 192..273

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

    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

        it('should open modal and downshift when clicked', () => {
          const wrapper = shallow(<ModulesSelectComponent {...commonProps} />);
          wrapper.find('button').simulate('click');
          const modal = wrapper.find(Modal);
          const downshift = wrapper.find(Downshift);
    Severity: Major
    Found in website/src/views/mpe/form/ModulesSelect.test.tsx and 1 other location - About 4 hrs to fix
    website/src/views/timetable/ModulesSelect.test.tsx on lines 86..93

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

    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

      test('show many results if the search only returns modules', () => {
        const { getByRole, getAllByRole } = make({
          venueBank: { venueList: range(100).map((n) => `Venue ${n}`) },
        });
    
    
    Severity: Major
    Found in website/src/views/layout/GlobalSearchContainer.test.tsx and 1 other location - About 4 hrs to fix
    website/src/views/layout/GlobalSearchContainer.test.tsx on lines 275..356

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

    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

    Function KeyboardShortcuts has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const KeyboardShortcuts: React.FC = () => {
      const [helpShown, setHelpShown] = useState(false);
      const closeModal = useCallback(() => setHelpShown(false), []);
    
      const store = useStore<State>();
    Severity: Major
    Found in website/src/views/components/KeyboardShortcuts.tsx - About 4 hrs to fix

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

        test('should throw on unknown error', async () => {
          mockedAxios.post.mockResolvedValue(
            mockResponse({ code: '20000', msg: 'The server is on fire', data: [] }),
          );
      
      
      Severity: Major
      Found in scrapers/nus-v2/src/services/nus-api.test.ts and 2 other locations - About 4 hrs to fix
      scrapers/nus-v2/src/services/nus-api.test.ts on lines 26..35
      scrapers/nus-v2/src/services/nus-api.test.ts on lines 37..46

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

      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 3 locations. Consider refactoring.
      Open

        test('should throw auth error', async () => {
          mockedAxios.post.mockResolvedValue(
            mockResponse({ code: '10000', msg: 'Incorrect user key', data: [] }),
          );
      
      
      Severity: Major
      Found in scrapers/nus-v2/src/services/nus-api.test.ts and 2 other locations - About 4 hrs to fix
      scrapers/nus-v2/src/services/nus-api.test.ts on lines 37..46
      scrapers/nus-v2/src/services/nus-api.test.ts on lines 48..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 126.

      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 3 locations. Consider refactoring.
      Open

        test('should throw not found error', async () => {
          mockedAxios.post.mockResolvedValue(
            mockResponse({ code: '10001', msg: 'Record not found', data: [] }),
          );
      
      
      Severity: Major
      Found in scrapers/nus-v2/src/services/nus-api.test.ts and 2 other locations - About 4 hrs to fix
      scrapers/nus-v2/src/services/nus-api.test.ts on lines 26..35
      scrapers/nus-v2/src/services/nus-api.test.ts on lines 48..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 126.

      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 3 locations. Consider refactoring.
      Open

          expect(reducer(initial, movePlannerModule('2', '2018/2019', 2, 0)).modules).toEqual({
            0: { id: '0', moduleCode: 'CS1010S', year: '2018/2019', semester: 1, index: 0 },
            1: { id: '1', moduleCode: 'CS2030', year: '2018/2019', semester: 2, index: 1 },
            2: { id: '2', moduleCode: 'CS2105', year: '2018/2019', semester: 2, index: 0 },
          });
      Severity: Major
      Found in website/src/reducers/planner.test.ts and 2 other locations - About 4 hrs to fix
      website/src/reducers/planner.test.ts on lines 178..182
      website/src/reducers/planner.test.ts on lines 184..188

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

      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 3 locations. Consider refactoring.
      Open

          expect(reducer(initial, movePlannerModule('0', '2017/2018', 2, 0)).modules).toEqual({
            0: { id: '0', moduleCode: 'CS1010S', year: '2017/2018', semester: 2, index: 0 },
            1: { id: '1', moduleCode: 'CS2030', year: '2018/2019', semester: 2, index: 0 },
            2: { id: '2', moduleCode: 'CS2105', year: '2018/2019', semester: 2, index: 1 },
          });
      Severity: Major
      Found in website/src/reducers/planner.test.ts and 2 other locations - About 4 hrs to fix
      website/src/reducers/planner.test.ts on lines 145..149
      website/src/reducers/planner.test.ts on lines 184..188

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

      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 3 locations. Consider refactoring.
      Open

          expect(reducer(initial, movePlannerModule('0', '2018/2019', 2, 1)).modules).toEqual({
            0: { id: '0', moduleCode: 'CS1010S', year: '2018/2019', semester: 2, index: 1 },
            1: { id: '1', moduleCode: 'CS2030', year: '2018/2019', semester: 2, index: 0 },
            2: { id: '2', moduleCode: 'CS2105', year: '2018/2019', semester: 2, index: 2 },
          });
      Severity: Major
      Found in website/src/reducers/planner.test.ts and 2 other locations - About 4 hrs to fix
      website/src/reducers/planner.test.ts on lines 145..149
      website/src/reducers/planner.test.ts on lines 178..182

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

      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

      export function validateLesson(lesson: TimetableLesson, logger: Logger = rootLogger) {
        const result = lessonSchema.validate(lesson, {
          presence: 'required',
          allowUnknown: true,
          // Don't abort early so we can log all errors
      Severity: Major
      Found in scrapers/nus-v2/src/services/validation.ts and 1 other location - About 4 hrs to fix
      scrapers/nus-v2/src/services/validation.ts on lines 58..68

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

      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

      export function validateExam(exam: ModuleExam, logger: Logger = rootLogger) {
        const result = examSchema.validate(exam, {
          presence: 'required',
          allowUnknown: true,
          // Don't abort early so we can log all errors
      Severity: Major
      Found in scrapers/nus-v2/src/services/validation.ts and 1 other location - About 4 hrs to fix
      scrapers/nus-v2/src/services/validation.ts on lines 39..49

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

      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

      Function scraper has 101 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      async function scraper() {
        const getDepartmentsResponse = await axios.post<ApiResponse<GetDepartmentsResponseData[]>>(
          `${baseUrl}/config/get-acadorg`,
          {
            eff_status: 'A',
      Severity: Major
      Found in scrapers/cpex-scraper/src/index.ts - About 4 hrs to fix

        Function TimetableModulesTableComponent has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const TimetableModulesTableComponent: React.FC<Props> = (props) => {
          const renderModuleActions = (module: ModuleWithColor) => {
            const hideBtnLabel = `${module.hiddenInTimetable ? 'Show' : 'Hide'} ${module.moduleCode}`;
            const removeBtnLabel = `Remove ${module.moduleCode} from timetable`;
            const { semester } = props;
        Severity: Major
        Found in website/src/views/timetable/TimetableModulesTable.tsx - About 4 hrs to fix

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

          describe(SET_PLANNER_MAX_YEAR, () => {
            test('should set max year', () => {
              expect(reducer(defaultState, setPlannerMaxYear('2020/2021'))).toEqual({
                ...defaultState,
                minYear: '2017/2018',
          Severity: Major
          Found in website/src/reducers/planner.test.ts and 1 other location - About 4 hrs to fix
          website/src/reducers/planner.test.ts on lines 38..54

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

          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