airbnb/caravel

View on GitHub
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx

Summary

Maintainability
D
1 day
Test Coverage

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

test('should return errors when not a float', async () => {
  const changeProps = {
    ...mockedProps,
    isFloat: true,
    value: null,
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 87..101

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

test('should return errors when not an int', async () => {
  const changeProps = {
    ...mockedProps,
    isInt: true,
    value: null,
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 71..85

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

test('should render as disabled', () => {
  const disabledProps = {
    ...mockedProps,
    disabled: true,
  };
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 43..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 67.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

test('should render', () => {
  const { container } = render(<TextControl {...mockedProps} />);
  expect(container).toBeInTheDocument();
});
superset-frontend/src/components/Badge/Badge.test.tsx on lines 27..30
superset-frontend/src/components/Datasource/Field.test.tsx on lines 34..37
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 38..41
superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx on lines 42..47
superset-frontend/src/components/ErrorMessage/ErrorAlert.test.tsx on lines 56..59
superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.test.tsx on lines 41..44
superset-frontend/src/components/ErrorMessage/IssueCode.test.tsx on lines 28..31
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx on lines 57..60
superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx on lines 56..59
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 28..31
superset-frontend/src/components/ProgressBar/ProgressBar.test.tsx on lines 26..29
superset-frontend/src/components/Slider/Slider.test.tsx on lines 29..32
superset-frontend/src/components/TableView/TableView.test.tsx on lines 46..49
superset-frontend/src/components/Tags/Tag.test.tsx on lines 32..35
superset-frontend/src/components/Tags/TagsList.test.tsx on lines 56..59
superset-frontend/src/features/tags/TagModal.test.tsx on lines 34..37

Duplicated Code

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

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

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

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

test('should render with placeholder', () => {
  render(<TextControl {...mockedProps} />);
  expect(screen.getByPlaceholderText('Placeholder')).toBeInTheDocument();
});
superset-frontend/src/components/Badge/Badge.test.tsx on lines 37..40
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 59..62
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 64..67
superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx on lines 49..52
superset-frontend/src/components/ErrorMessage/IssueCode.test.tsx on lines 33..36
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx on lines 62..65
superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx on lines 61..64
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 33..36
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 38..41
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 52..55
superset-frontend/src/components/ProgressBar/ProgressBar.test.tsx on lines 31..34
superset-frontend/src/components/TableView/TableView.test.tsx on lines 51..54
superset-frontend/src/components/TableView/TableView.test.tsx on lines 85..88
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 36..39
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 41..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 51.

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

test('should render a textbox', () => {
  render(<TextControl {...mockedProps} />);
  expect(screen.getByRole('textbox')).toBeInTheDocument();
});
superset-frontend/src/components/Badge/Badge.test.tsx on lines 37..40
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 59..62
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 64..67
superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx on lines 49..52
superset-frontend/src/components/ErrorMessage/IssueCode.test.tsx on lines 33..36
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx on lines 62..65
superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx on lines 61..64
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 33..36
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 38..41
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 52..55
superset-frontend/src/components/ProgressBar/ProgressBar.test.tsx on lines 31..34
superset-frontend/src/components/TableView/TableView.test.tsx on lines 51..54
superset-frontend/src/components/TableView/TableView.test.tsx on lines 85..88
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 41..44
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 46..49

Duplicated Code

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

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

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

Tuning

This issue has a mass of 51.

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

test('should render with initial value', () => {
  render(<TextControl {...mockedProps} />);
  expect(screen.getByDisplayValue('Sample value')).toBeInTheDocument();
});
superset-frontend/src/components/Badge/Badge.test.tsx on lines 37..40
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 59..62
superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx on lines 64..67
superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.test.tsx on lines 49..52
superset-frontend/src/components/ErrorMessage/IssueCode.test.tsx on lines 33..36
superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.test.tsx on lines 62..65
superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.test.tsx on lines 61..64
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 33..36
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 38..41
superset-frontend/src/components/ModalTrigger/ModalTrigger.test.tsx on lines 52..55
superset-frontend/src/components/ProgressBar/ProgressBar.test.tsx on lines 31..34
superset-frontend/src/components/TableView/TableView.test.tsx on lines 51..54
superset-frontend/src/components/TableView/TableView.test.tsx on lines 85..88
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 36..39
superset-frontend/src/explore/components/controls/TextControl/TextControl.test.tsx on lines 46..49

Duplicated Code

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

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

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

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status