ahbeng/NUSMods

View on GitHub
website/src/utils/timetables.test.ts

Summary

Maintainability
F
4 days
Test Coverage

File timetables.test.ts has 570 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import NUSModerator from 'nusmoderator';
import _ from 'lodash';
import { parseISO } from 'date-fns';
import {
  ColoredLesson,
Severity: Major
Found in website/src/utils/timetables.test.ts - About 1 day to fix

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

    test('findExamClashes should return non-empty object if exams starting at different times clash', () => {
      const sem: Semester = 1;
      const examClashes = findExamClashes([CS1010S, CS3216 as any, CS1010A], sem);
      const examDate = _.get(getModuleSemesterData(CS1010A, sem), 'examDate');
      if (!examDate) throw new Error('Cannot find ExamDate');
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 3 hrs to fix
    website/src/utils/timetables.test.ts on lines 368..374

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

    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('findExamClashes should return non-empty object if exams clash', () => {
      const sem: Semester = 1;
      const examClashes = findExamClashes([CS1010S, CS4243 as any, CS3216], sem);
      const examDate = _.get(getModuleSemesterData(CS1010S, sem), 'examDate');
      if (!examDate) throw new Error('Cannot find ExamDate');
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 3 hrs to fix
    website/src/utils/timetables.test.ts on lines 382..388

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

    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(getEndTimeAsDate, () => {
      test('should return end time as date', () => {
        const date = new Date(2018, 5, 10);
        const lesson = createGenericLesson('Monday', '0830', '1045');
        expect(getEndTimeAsDate(lesson, date)).toEqual(new Date(2018, 5, 10, 10, 45));
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 2 hrs to fix
    website/src/utils/timetables.test.ts on lines 641..647

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

    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(getStartTimeAsDate, () => {
      test('should return start time as date', () => {
        const date = new Date(2018, 5, 10);
        const lesson = createGenericLesson('Monday', '0830', '1045');
        expect(getStartTimeAsDate(lesson, date)).toEqual(new Date(2018, 5, 10, 8, 30));
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 2 hrs to fix
    website/src/utils/timetables.test.ts on lines 649..655

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

    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 arrangement1: TimetableArrangement = arrangeLessonsForWeek(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Monday', '1600', '1800'),
          createGenericColoredLesson('Monday', '1400', '1500'),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 1 hr to fix
    website/src/utils/timetables.test.ts on lines 289..297

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

    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 arrangement2: TimetableArrangement = arrangeLessonsForWeek(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Monday', '1600', '1800'),
          createGenericColoredLesson('Monday', '1400', '1500'),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 1 hr to fix
    website/src/utils/timetables.test.ts on lines 277..285

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

    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(
        isSameTimetableConfig(
          { CS2104: { Lecture: '1', Tutorial: '2' } },
          { CS2104: { Lecture: '2', Tutorial: '1' } },
        ),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 1 hr to fix
    website/src/utils/timetables.test.ts on lines 436..441

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

    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(
        isSameTimetableConfig(
          { CS2104: { Tutorial: '1', Lecture: '2' } },
          { CS2104: { Lecture: '2', Tutorial: '1' } },
        ),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 1 other location - About 1 hr to fix
    website/src/utils/timetables.test.ts on lines 458..463

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

    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 lessons1: RawLesson[] = _.shuffle([
        createGenericLesson('Monday', '1000', '1200', 'Lecture', '1'),
        createGenericLesson('Monday', '1600', '1800', 'Lecture', '2'),
        createGenericLesson('Monday', '1400', '1500', 'Lecture', '3'),
      ]);
    Severity: Minor
    Found in website/src/utils/timetables.test.ts and 1 other location - About 55 mins to fix
    website/src/utils/timetables.test.ts on lines 350..354

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

    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 lessons2: RawLesson[] = _.shuffle([
        createGenericLesson('Monday', '1000', '1200', 'Lecture', '1'),
        createGenericLesson('Monday', '1600', '1800', 'Lecture', '1'),
        createGenericLesson('Monday', '1400', '1500', 'Lecture', '1'),
      ]);
    Severity: Minor
    Found in website/src/utils/timetables.test.ts and 1 other location - About 55 mins to fix
    website/src/utils/timetables.test.ts on lines 341..345

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

    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('should replace lessons with invalid class no', () => {
        expect(
          validateModuleLessons(
            semester,
            {
    Severity: Minor
    Found in website/src/utils/timetables.test.ts and 1 other location - About 45 mins to fix
    website/src/utils/timetables.test.ts on lines 518..529

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

    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('should remove lesson types which do not exist', () => {
        expect(
          validateModuleLessons(
            semester,
            {
    Severity: Minor
    Found in website/src/utils/timetables.test.ts and 1 other location - About 45 mins to fix
    website/src/utils/timetables.test.ts on lines 531..542

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

    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

      const arrangement2: TimetableDayArrangement = arrangeLessonsWithinDay(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Monday', '1600', '1800'),
          createGenericColoredLesson('Monday', '1500', '1700'),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 2 other locations - About 40 mins to fix
    website/src/utils/timetables.test.ts on lines 237..243
    website/src/utils/timetables.test.ts on lines 257..263

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

    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

      const arrangement3: TimetableDayArrangement = arrangeLessonsWithinDay(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Monday', '1100', '1300'),
          createGenericColoredLesson('Monday', '1000', '1300'),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 2 other locations - About 40 mins to fix
    website/src/utils/timetables.test.ts on lines 237..243
    website/src/utils/timetables.test.ts on lines 247..253

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

    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

      const arrangement1: TimetableDayArrangement = arrangeLessonsWithinDay(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Monday', '1600', '1800'),
          createGenericColoredLesson('Monday', '1400', '1500'),
    Severity: Major
    Found in website/src/utils/timetables.test.ts and 2 other locations - About 40 mins to fix
    website/src/utils/timetables.test.ts on lines 247..253
    website/src/utils/timetables.test.ts on lines 257..263

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

    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 arrangement3: TimetableArrangement = arrangeLessonsForWeek(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Tuesday', '1100', '1300'),
          createGenericColoredLesson('Wednesday', '1000', '1300'),
    Severity: Minor
    Found in website/src/utils/timetables.test.ts and 1 other location - About 35 mins to fix
    website/src/utils/timetables.test.ts on lines 268..274

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

    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 arrangement0: TimetableArrangement = arrangeLessonsForWeek(
        _.shuffle([
          createGenericColoredLesson('Monday', '1000', '1200'),
          createGenericColoredLesson('Monday', '1600', '1800'),
          createGenericColoredLesson('Monday', '1400', '1500'),
    Severity: Minor
    Found in website/src/utils/timetables.test.ts and 1 other location - About 35 mins to fix
    website/src/utils/timetables.test.ts on lines 301..307

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

    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

    There are no issues that match your filters.

    Category
    Status