JamieMason/expect-more

View on GitHub

Showing 315 of 315 total issues

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

export const toBeBeforeMatcher = (value: unknown, other: Date): jest.CustomMatcherResult =>
  createResult({
    message: () =>
      `expected ${printReceived(value)} to be an instance of Date, occurring before ${printExpected(
        other,
Severity: Major
Found in packages/expect-more-jest/src/to-be-before.ts and 1 other location - About 3 hrs to fix
packages/expect-more-jest/src/to-be-after.ts on lines 30..41

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

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 = (
  value: unknown,
  requiredValues: unknown[],
): jest.CustomMatcherResult =>
  createResult({
packages/expect-more-jest/src/to-be-array-including-any-of.ts on lines 30..44
packages/expect-more-jest/src/to-be-array-including-only.ts on lines 30..44

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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 = (
  value: unknown,
  allowedValues: unknown[],
): jest.CustomMatcherResult =>
  createResult({
Severity: Major
Found in packages/expect-more-jest/src/to-be-array-including-only.ts and 2 other locations - About 3 hrs to fix
packages/expect-more-jest/src/to-be-array-including-all-of.ts on lines 30..44
packages/expect-more-jest/src/to-be-array-including-any-of.ts on lines 30..44

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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 = (value: unknown, otherDate: Date): jest.CustomMatcherResult =>
  createResult({
    message: () =>
      `expected ${printReceived(value)} to be an instance of Date, occurring after ${printExpected(
        otherDate,
Severity: Major
Found in packages/expect-more-jest/src/to-be-after.ts and 1 other location - About 3 hrs to fix
packages/expect-more-jest/src/to-be-before.ts on lines 30..41

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

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 = (
  value: unknown,
  allowedValues: unknown[],
): jest.CustomMatcherResult =>
  createResult({
packages/expect-more-jest/src/to-be-array-including-all-of.ts on lines 30..44
packages/expect-more-jest/src/to-be-array-including-only.ts on lines 30..44

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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 generateDocsForPackage has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

const generateDocsForPackage = (name: string): void => {
  const rootDir = path.resolve(__dirname, '..');
  const fullApi = [];

  const visitFile = ({ filePath, gitHubUrl }) => {
Severity: Minor
Found in scripts/generate-docs.ts - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

export const toBeValidDateMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isValidDate(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-valid-date.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeNegativeNumberMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isNegativeNumber(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-negative-number.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeNonEmptyObjectMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isNonEmptyObject(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-non-empty-object.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeNilMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isNil(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-nil.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeRegExpMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isRegExp(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-reg-exp.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeArrayOfNumbersMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isArrayOfNumbers(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-array-of-numbers.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeNumberMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isNumber(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-number.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeJsonStringMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isJsonString(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-json-string.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeEmptyObjectMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isEmptyObject(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-empty-object.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeWholeNumberMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isWholeNumber(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-whole-number.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32

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

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

export const toBeIso8601Matcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isIso8601(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-iso8601.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeCalculableMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isCalculable(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-calculable.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeEvenNumberMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isEvenNumber(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-even-number.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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

export const toBeDateMatcher: jasmine.CustomMatcherFactory = () => {
  return {
    compare(value: unknown) {
      const pass = isDate(value);
      const message = pass
Severity: Major
Found in packages/expect-more-jasmine/src/to-be-date.ts and 33 other locations - About 3 hrs to fix
packages/expect-more-jasmine/src/to-be-array-of-booleans.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-array-of-numbers.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-objects.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array-of-strings.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-async-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-boolean.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-calculable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-decimal-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-even-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-generator-function.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-iso8601.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-json-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-negative-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-nil.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-array.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-non-empty-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-object.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-odd-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-positive-number.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-reg-exp.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-string.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-valid-date.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-visible-string.ts on lines 20..34
packages/expect-more-jasmine/src/to-be-walkable.ts on lines 20..30
packages/expect-more-jasmine/src/to-be-whitespace.ts on lines 20..32
packages/expect-more-jasmine/src/to-be-whole-number.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 106.

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