JamieMason/expect-more

View on GitHub

Showing 315 of 315 total issues

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

export const toHaveDateOnOrAfterMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, propPath: string, other: unknown) {
      const pass = isDateOnOrAfter(other, getIn(propPath.split('.'), value));
      const message = pass
packages/expect-more-jasmine/src/to-have-date-on-or-before.ts on lines 19..33
packages/expect-more-jasmine/src/to-have-ending-with.ts on lines 19..33

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

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

export const toBeShorterThanMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: string | any[]) {
      const pass = isShorterThan(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-shorter-than.ts and 2 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-longer-than.ts on lines 20..36
packages/expect-more-jasmine/src/to-be-same-length-as.ts on lines 20..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 133.

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

export const toBeSameLengthAsMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: string | any[]) {
      const pass = isSameLengthAs(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-same-length-as.ts and 2 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-longer-than.ts on lines 20..36
packages/expect-more-jasmine/src/to-be-shorter-than.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 133.

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

export const toBeLongerThanMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: string | any[]) {
      const pass = isLongerThan(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-longer-than.ts and 2 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-same-length-as.ts on lines 20..36
packages/expect-more-jasmine/src/to-be-shorter-than.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 133.

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

export const toBeArrayIncludingAllOfMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, requiredValues: unknown[]) {
      const pass = isArrayIncludingAllOf(requiredValues, value);
      const message = pass
packages/expect-more-jasmine/src/to-be-array-including-any-of.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-including-only.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

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 toBeBeforeMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: Date) {
      const pass = isBefore(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-before.ts and 1 other location - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-after.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

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 toBeAfterMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, otherDate: Date) {
      const pass = isAfter(otherDate, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-after.ts and 1 other location - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-before.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

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

export const toBeArrayIncludingOnlyMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, allowedValues: unknown[]) {
      const pass = isArrayIncludingOnly(allowedValues, value);
      const message = pass
packages/expect-more-jasmine/src/to-be-array-including-all-of.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-including-any-of.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

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

export const toBeArrayIncludingAnyOfMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, allowedValues: unknown[]) {
      const pass = isArrayIncludingAnyOf(allowedValues, value);
      const message = pass
packages/expect-more-jasmine/src/to-be-array-including-all-of.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-including-only.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

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

export const toBeDateInMonthMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, index: number) {
      const pass = isDateInMonth(index, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-date-in-month.ts and 5 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-size.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-in-year.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-on-day-of-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-on-day-of-week.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-divisible-by.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 3 locations. Consider refactoring.
Open

export const toEndWithMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, otherString: unknown) {
      const pass = endsWith(otherString, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-end-with.ts and 2 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-date-on-or-after.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-on-or-before.ts on lines 20..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 6 locations. Consider refactoring.
Open

export const toBeArrayOfSizeMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, size: number) {
      const pass = isArrayOfSize(size, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-array-of-size.ts and 5 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-date-in-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-in-year.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-on-day-of-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-on-day-of-week.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-divisible-by.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 3 locations. Consider refactoring.
Open

export const toBeDateOnOrAfterMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: unknown) {
      const pass = isDateOnOrAfter(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-date-on-or-after.ts and 2 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-date-on-or-before.ts on lines 20..34
packages/expect-more-jasmine/src/to-end-with.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 6 locations. Consider refactoring.
Open

export const toBeDateOnDayOfMonthMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, dayOfMonth: number) {
      const pass = isDateOnDayOfMonth(dayOfMonth, value);
      const message = pass
packages/expect-more-jasmine/src/to-be-array-of-size.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-in-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-in-year.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-on-day-of-week.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-divisible-by.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 6 locations. Consider refactoring.
Open

export const toBeDivisibleByMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: number) {
      const pass = isDivisibleBy(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-divisible-by.ts and 5 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-size.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-in-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-in-year.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-on-day-of-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-on-day-of-week.ts on lines 20..38

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

export const toBeDateOnDayOfWeekMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, index: number) {
      const pass = isDateOnDayOfWeek(index, value);
      const message = pass
packages/expect-more-jasmine/src/to-be-array-of-size.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-in-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-in-year.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-on-day-of-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-divisible-by.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 6 locations. Consider refactoring.
Open

export const toBeDateInYearMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, year: number) {
      const pass = isDateInYear(year, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-date-in-year.ts and 5 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-size.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-date-in-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-on-day-of-month.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-date-on-day-of-week.ts on lines 20..38
packages/expect-more-jasmine/src/to-be-divisible-by.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 3 locations. Consider refactoring.
Open

export const toBeDateOnOrBeforeMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown, other: unknown) {
      const pass = isDateOnOrBefore(other, value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-date-on-or-before.ts and 2 other locations - About 4 hrs to fix
packages/expect-more-jasmine/src/to-be-date-on-or-after.ts on lines 20..34
packages/expect-more-jasmine/src/to-end-with.ts on lines 20..30

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 getMetadata has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getMetadata = (filePath): FileMeta => {
  const sourceFile = program.getSourceFile(filePath);
  const result: FileMeta = {
    filePath,
    inputs: [],
Severity: Major
Found in scripts/generate-matchers/index.ts - About 4 hrs to fix

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

    export const toHaveDecimalNumberMatcher: jasmine.CustomMatcherFactory = () => {
      return {
        compare(value: unknown, propPath: string) {
          const pass = isDecimalNumber(getIn(propPath.split('.'), value));
          const message = pass
    Severity: Major
    Found in packages/expect-more-jasmine/src/to-have-decimal-number.ts and 37 other locations - About 4 hrs to fix
    packages/expect-more-jasmine/src/to-have-array-of-booleans.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-array-of-numbers.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-array-of-objects.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-array-of-strings.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-array.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-async-function.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-boolean.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-calculable.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-date.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-empty-array.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-empty-object.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-empty-string.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-even-number.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-false.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-generator-function.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-iso8601.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-json-string.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-method.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-negative-number.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-nil.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-non-empty-array.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-non-empty-object.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-non-empty-string.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-null.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-number.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-object.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-odd-number.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-positive-number.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-reg-exp.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-string.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-true.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-undefined.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-valid-date.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-visible-string.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-walkable.ts on lines 19..29
    packages/expect-more-jasmine/src/to-have-whitespace.ts on lines 19..33
    packages/expect-more-jasmine/src/to-have-whole-number.ts on lines 19..29

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

    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