ethanneff/example

View on GitHub

Showing 71 of 120 total issues

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

  it('a day ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { days: 1 }));
    expect(formatRelativeDate(date)).toBe('1d');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('2 days ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { days: 3 }));
    expect(formatRelativeDate(date)).toBe('3d');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('20 minutes ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { minutes: 20 }));
    expect(formatRelativeDate(date)).toBe('20m');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('3 years ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { years: 3 }));
    expect(formatRelativeDate(date)).toBe('3y');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61

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

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

  it('a month ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { months: 1 }));
    expect(formatRelativeDate(date)).toBe('4w');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('30 seconds ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { seconds: 30 }));
    expect(formatRelativeDate(date)).toBe('');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('3 hours ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { hours: 3 }));
    expect(formatRelativeDate(date)).toBe('3h');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('a year ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { years: 1 }));
    expect(formatRelativeDate(date)).toBe('1y');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('an hour ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { hours: 1 }));
    expect(formatRelativeDate(date)).toBe('1h');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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 const checklistItemTriggerSchema = z.object({
  id: z.string(),
  itemId: z.string(),
  triggerId: z.string(),
  userId: z.string(),
Severity: Major
Found in src/apps/Checklists/data/types.ts and 1 other location - About 1 hr to fix
src/apps/Checklists/data/types.ts on lines 40..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 67.

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 const checklistActivitySchema = z.object({
  checklistId: z.string(),
  date: z.number(),
  id: z.string(),
  userId: z.string(),
Severity: Major
Found in src/apps/Checklists/data/types.ts and 1 other location - About 1 hr to fix
src/apps/Checklists/data/types.ts on lines 31..36

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

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

  it('a few seconds ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { seconds: 10 }));
    expect(formatRelativeDate(date)).toBe('');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 52..56
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

  it('3 months ago', () => {
    expect.hasAssertions();
    const date = toDate(sub(new Date(), { months: 3 }));
    expect(formatRelativeDate(date)).toBe('13w');
  });
Severity: Major
Found in src/apps/Playground/Features/SwipeFeed/__tests__/index.ts and 11 other locations - About 1 hr to fix
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 7..11
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 12..16
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 17..21
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 22..26
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 27..31
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 32..36
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 37..41
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 42..46
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 47..51
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 57..61
src/apps/Playground/Features/SwipeFeed/__tests__/index.ts on lines 62..66

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

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

export const Progress = () => (
  <Stack.Navigator screenOptions={noHeader}>
    <Stack.Screen
      component={Home}
      name="home"
Severity: Major
Found in src/apps/Progress/index.tsx and 4 other locations - About 1 hr to fix
src/apps/CantHurtMe/index.tsx on lines 8..15
src/apps/ComfortZone/index.tsx on lines 8..15
src/apps/Journal/index.tsx on lines 8..15
src/apps/TheOneThing/index.tsx on lines 8..15

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

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

export const ComfortZone = () => (
  <Stack.Navigator screenOptions={noHeader}>
    <Stack.Screen
      component={Home}
      name="home"
Severity: Major
Found in src/apps/ComfortZone/index.tsx and 4 other locations - About 1 hr to fix
src/apps/CantHurtMe/index.tsx on lines 8..15
src/apps/Journal/index.tsx on lines 8..15
src/apps/Progress/index.tsx on lines 8..15
src/apps/TheOneThing/index.tsx on lines 8..15

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

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

export const CantHurtMe = () => (
  <Stack.Navigator screenOptions={noHeader}>
    <Stack.Screen
      component={Home}
      name="home"
Severity: Major
Found in src/apps/CantHurtMe/index.tsx and 4 other locations - About 1 hr to fix
src/apps/ComfortZone/index.tsx on lines 8..15
src/apps/Journal/index.tsx on lines 8..15
src/apps/Progress/index.tsx on lines 8..15
src/apps/TheOneThing/index.tsx on lines 8..15

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

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

export const TheOneThing = () => (
  <Stack.Navigator screenOptions={noHeader}>
    <Stack.Screen
      component={Home}
      name="home"
Severity: Major
Found in src/apps/TheOneThing/index.tsx and 4 other locations - About 1 hr to fix
src/apps/CantHurtMe/index.tsx on lines 8..15
src/apps/ComfortZone/index.tsx on lines 8..15
src/apps/Journal/index.tsx on lines 8..15
src/apps/Progress/index.tsx on lines 8..15

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

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

export const Journal = () => (
  <Stack.Navigator screenOptions={noHeader}>
    <Stack.Screen
      component={Home}
      name="home"
Severity: Major
Found in src/apps/Journal/index.tsx and 4 other locations - About 1 hr to fix
src/apps/CantHurtMe/index.tsx on lines 8..15
src/apps/ComfortZone/index.tsx on lines 8..15
src/apps/Progress/index.tsx on lines 8..15
src/apps/TheOneThing/index.tsx on lines 8..15

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

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

      <ScrollView
        contentContainerStyle={{ padding: spacing(4) }}
        style={{ backgroundColor: colors.background.secondary }}
      >
        <Card>
Severity: Major
Found in src/apps/DeepWork/Account.tsx and 1 other location - About 1 hr to fix
src/apps/DeepWork/Day.tsx on lines 16..31

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

      <ScrollView
        contentContainerStyle={{
          backgroundColor: colors.background.secondary,
          padding: spacing(4),
        }}
Severity: Major
Found in src/apps/DeepWork/Day.tsx and 1 other location - About 1 hr to fix
src/apps/DeepWork/Account.tsx on lines 15..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 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

Severity
Category
Status
Source
Language