airbnb/caravel

View on GitHub

Showing 3,672 of 6,072 total issues

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

    const hasError = Object.values(props.controls).some(
      control =>
        control.validationErrors && control.validationErrors.length > 0,
    );
superset-frontend/src/explore/components/ExploreViewContainer/index.jsx on lines 509..512

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

            tab={
              extra.disallow_adhoc_metrics ? (
                <Tooltip
                  title={t(
                    'Simple ad-hoc metrics are not enabled for this dataset',
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx on lines 462..474

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

      const sortedNames = Object.values(props.slices)
        .sort(SliceAdder.sortByComparator('slice_name'))
        .map(slice => slice.slice_name);
Severity: Minor
Found in superset-frontend/src/dashboard/components/SliceAdder.test.jsx and 1 other location - About 50 mins to fix
superset-frontend/src/dashboard/components/SliceAdder.test.jsx on lines 50..52

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 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 span element by default', () => {
  render(<ModalTrigger {...mockedProps} />);
  expect(screen.getByTestId('span-modal-trigger')).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 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
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 the message', () => {
  render(<IssueCode {...mockedProps} />);
  expect(screen.getByText('Error message')).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/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
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 a button', () => {
  render(<ModalTrigger {...mockedProps} />);
  expect(screen.getByRole('button')).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 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
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 the error title', () => {
  render(<BasicErrorAlert {...mockedProps} />);
  expect(screen.getByText('Error title')).toBeInTheDocument();
});
superset-frontend/src/components/Badge/Badge.test.tsx on lines 37..40
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
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 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 the default title', () => {
  render(<ParameterErrorMessage {...mockedProps} />);
  expect(screen.getByText('Parameter error')).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/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
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 show the row count by default', () => {
  render(<TableView {...mockedProps} />);
  expect(screen.getByText('1-1 of 2')).toBeInTheDocument();
});
Severity: Major
Found in superset-frontend/src/components/TableView/TableView.test.tsx and 15 other locations - About 50 mins to fix
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/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
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 the default title', () => {
  render(<TimeoutErrorMessage {...mockedProps} />);
  expect(screen.getByText('Timeout error')).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/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
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 the default title', () => {
  render(<DatasetNotFoundErrorMessage {...mockedProps} />);
  expect(screen.getByText('Missing dataset')).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/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
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 the error body', () => {
  render(<BasicErrorAlert {...mockedProps} />);
  expect(screen.getByText('Error body')).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/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
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 the text', () => {
  render(<Badge {...mockedProps} />);
  expect(screen.getByText('Text')).toBeInTheDocument();
});
Severity: Major
Found in superset-frontend/src/components/Badge/Badge.test.tsx and 15 other locations - About 50 mins to fix
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
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

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

test('should render with info', () => {
  render(<ProgressBar {...mockedProps} />);
  expect(screen.getByText('90%')).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/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
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 triggerNode', () => {
  render(<ModalTrigger {...mockedProps} />);
  expect(screen.getByText('Trigger')).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/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
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 10 locations. Consider refactoring.
Open

const Styles = styled.div`
  .recentCards {
    max-height: none;
    grid-gap: ${({ theme }) => `${theme.gridUnit * 4}px`};
  }
Severity: Major
Found in superset-frontend/src/features/home/ActivityTable.tsx and 9 other locations - About 50 mins to fix
superset-frontend/src/components/Datasource/CollectionTable.tsx on lines 146..149
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx on lines 45..53
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx on lines 31..35
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx on lines 114..121
superset-frontend/src/explore/components/DataTableControl/index.tsx on lines 152..157
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx on lines 31..42
superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx on lines 32..34
superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx on lines 35..37
superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 134..138

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

const Error = styled.pre`
  margin-top: ${({ theme }) => `${theme.gridUnit * 4}px`};
`;
superset-frontend/src/components/Datasource/CollectionTable.tsx on lines 146..149
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx on lines 45..53
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx on lines 31..35
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx on lines 114..121
superset-frontend/src/explore/components/DataTableControl/index.tsx on lines 152..157
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx on lines 31..42
superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx on lines 32..34
superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 134..138
superset-frontend/src/features/home/ActivityTable.tsx on lines 78..83

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

Severity
Category
Status
Source
Language