airbnb/superset

View on GitHub

Showing 3,638 of 5,983 total issues

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

test('is valid', () => {
  expect(React.isValidElement(<QueryStateLabel {...mockedProps} />)).toBe(true);
});
superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx on lines 29..31
superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx on lines 37..39
superset-frontend/src/SqlLab/components/TableElement/TableElement.test.tsx on lines 77..79
superset-frontend/src/components/CachedLabel/CachedLabel.test.tsx on lines 32..34
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 34..38
superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx on lines 111..117

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

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

test('renders with props', () => {
  expect(React.isValidElement(<TableElement {...mockedProps} />)).toBe(true);
});
superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx on lines 29..31
superset-frontend/src/SqlLab/components/QueryStateLabel/QueryStateLabel.test.tsx on lines 31..33
superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx on lines 37..39
superset-frontend/src/components/CachedLabel/CachedLabel.test.tsx on lines 32..34
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 34..38
superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx on lines 111..117

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

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

test('is valid with props', () => {
  expect(React.isValidElement(<QueryTable {...mockedProps} />)).toBe(true);
});
superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx on lines 29..31
superset-frontend/src/SqlLab/components/QueryStateLabel/QueryStateLabel.test.tsx on lines 31..33
superset-frontend/src/SqlLab/components/TableElement/TableElement.test.tsx on lines 77..79
superset-frontend/src/components/CachedLabel/CachedLabel.test.tsx on lines 32..34
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 34..38
superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx on lines 111..117

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

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

  it('is valid', () => {
    expect(React.isValidElement(<CachedLabel {...defaultProps} />)).toBe(true);
  });
superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx on lines 29..31
superset-frontend/src/SqlLab/components/QueryStateLabel/QueryStateLabel.test.tsx on lines 31..33
superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx on lines 37..39
superset-frontend/src/SqlLab/components/TableElement/TableElement.test.tsx on lines 77..79
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 34..38
superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx on lines 111..117

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

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

  it('is valid element', () => {
    expect(React.isValidElement(<FilterableTable {...mockedProps} />)).toBe(
      true,
    );
  });
superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx on lines 29..31
superset-frontend/src/SqlLab/components/QueryStateLabel/QueryStateLabel.test.tsx on lines 31..33
superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx on lines 37..39
superset-frontend/src/SqlLab/components/TableElement/TableElement.test.tsx on lines 77..79
superset-frontend/src/components/CachedLabel/CachedLabel.test.tsx on lines 32..34
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx on lines 111..117

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

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

  it('is valid with props', () => {
    expect(React.isValidElement(<ColumnElement {...mockedProps} />)).toBe(true);
  });
superset-frontend/src/SqlLab/components/QueryStateLabel/QueryStateLabel.test.tsx on lines 31..33
superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx on lines 37..39
superset-frontend/src/SqlLab/components/TableElement/TableElement.test.tsx on lines 77..79
superset-frontend/src/components/CachedLabel/CachedLabel.test.tsx on lines 32..34
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 34..38
superset-frontend/src/dashboard/components/RefreshIntervalModal.test.tsx on lines 111..117

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

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

test('is valid', () => {
  expect(
    React.isValidElement(
      <RefreshIntervalModal {...defaultRefreshIntervalModalProps} />,
    ),
superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx on lines 29..31
superset-frontend/src/SqlLab/components/QueryStateLabel/QueryStateLabel.test.tsx on lines 31..33
superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx on lines 37..39
superset-frontend/src/SqlLab/components/TableElement/TableElement.test.tsx on lines 77..79
superset-frontend/src/components/CachedLabel/CachedLabel.test.tsx on lines 32..34
superset-frontend/src/components/EditableTitle/EditableTitle.test.tsx on lines 41..43
superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 34..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

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

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

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

Refactorings

Further Reading

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

export const StyledRowFormItem = styled(FormItem)`
  margin-bottom: 0;
  padding-bottom: 0;
  min-width: 50%;

superset-frontend/src/features/databases/DatabaseModal/styles.ts on lines 567..569
superset-frontend/src/features/datasets/styles.ts on lines 58..62
superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 85..87
superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 106..109

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

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

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

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

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

Refactorings

Further Reading

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

export const StyledFooterButton = styled(Button)`
  width: ${({ theme }) => theme.gridUnit * 40}px;
`;
Severity: Major
Found in superset-frontend/src/features/reports/ReportModal/styles.tsx and 4 other locations - About 30 mins to fix
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx on lines 150..166
superset-frontend/src/features/databases/DatabaseModal/styles.ts on lines 567..569
superset-frontend/src/features/datasets/styles.ts on lines 58..62
superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 106..109

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

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

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

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

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

Refactorings

Further Reading

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

export const StyledRadio = styled(Radio)`
  display: block;
  line-height: ${({ theme }) => theme.gridUnit * 8}px;
`;
Severity: Major
Found in superset-frontend/src/features/reports/ReportModal/styles.tsx and 4 other locations - About 30 mins to fix
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx on lines 150..166
superset-frontend/src/features/databases/DatabaseModal/styles.ts on lines 567..569
superset-frontend/src/features/datasets/styles.ts on lines 58..62
superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 85..87

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

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

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

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

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

Refactorings

Further Reading

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

test('extracts DB configuration files that need passwords', () => {
  const passwordsNeeded = getPasswordsNeeded(passwordNeededErrors.errors);
  expect(passwordsNeeded).toEqual(['databases/imported_database.yaml']);
});
Severity: Major
Found in superset-frontend/src/views/CRUD/utils.test.tsx and 4 other locations - About 30 mins to fix
superset-frontend/src/views/CRUD/utils.test.tsx on lines 283..288
superset-frontend/src/views/CRUD/utils.test.tsx on lines 290..295
superset-frontend/src/views/CRUD/utils.test.tsx on lines 297..304
superset-frontend/src/views/CRUD/utils.test.tsx on lines 306..309

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

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

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

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

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

Refactorings

Further Reading

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

test('extracts DB configuration files that need ssh_tunnel private_keys', () => {
  const sshPrivateKeysNeeded = getSSHPrivateKeysNeeded(
    sshTunnelPrivateKeyNeededErrors.errors,
  );
  expect(sshPrivateKeysNeeded).toEqual(['databases/imported_database.yaml']);
Severity: Major
Found in superset-frontend/src/views/CRUD/utils.test.tsx and 4 other locations - About 30 mins to fix
superset-frontend/src/views/CRUD/utils.test.tsx on lines 278..281
superset-frontend/src/views/CRUD/utils.test.tsx on lines 283..288
superset-frontend/src/views/CRUD/utils.test.tsx on lines 297..304
superset-frontend/src/views/CRUD/utils.test.tsx on lines 306..309

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

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

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

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

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

Refactorings

Further Reading

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

export function isIntervalAnnotationLayer(
  layer: AnnotationLayer,
): layer is IntervalAnnotationLayer {
  return layer.annotationType === AnnotationType.Interval;
}
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 131..135
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 137..141
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 149..153
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 155..159

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

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

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

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

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

Refactorings

Further Reading

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

export function isTimeseriesAnnotationLayer(
  layer: AnnotationLayer,
): layer is TimeseriesAnnotationLayer {
  return layer.annotationType === AnnotationType.Timeseries;
}
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 131..135
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 137..141
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 143..147
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 155..159

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

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

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

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

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

Refactorings

Further Reading

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

test('extracts DB configuration files that need ssh_tunnel passwords', () => {
  const sshPasswordsNeeded = getSSHPasswordsNeeded(
    sshTunnelPasswordNeededErrors.errors,
  );
  expect(sshPasswordsNeeded).toEqual(['databases/imported_database.yaml']);
Severity: Major
Found in superset-frontend/src/views/CRUD/utils.test.tsx and 4 other locations - About 30 mins to fix
superset-frontend/src/views/CRUD/utils.test.tsx on lines 278..281
superset-frontend/src/views/CRUD/utils.test.tsx on lines 290..295
superset-frontend/src/views/CRUD/utils.test.tsx on lines 297..304
superset-frontend/src/views/CRUD/utils.test.tsx on lines 306..309

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

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

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

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

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

Refactorings

Further Reading

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

export const StyledFooterButton = styled(Button)`
  width: ${({ theme }) => theme.gridUnit * 40}px;
`;
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx on lines 150..166
superset-frontend/src/features/datasets/styles.ts on lines 58..62
superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 85..87
superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 106..109

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

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

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

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

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

Refactorings

Further Reading

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

test('extracts files that need overwrite confirmation', () => {
  const alreadyExists = getAlreadyExists(overwriteNeededErrors.errors);
  expect(alreadyExists).toEqual(['databases/imported_database.yaml']);
});
Severity: Major
Found in superset-frontend/src/views/CRUD/utils.test.tsx and 4 other locations - About 30 mins to fix
superset-frontend/src/views/CRUD/utils.test.tsx on lines 278..281
superset-frontend/src/views/CRUD/utils.test.tsx on lines 283..288
superset-frontend/src/views/CRUD/utils.test.tsx on lines 290..295
superset-frontend/src/views/CRUD/utils.test.tsx on lines 297..304

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

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

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

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

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

Refactorings

Further Reading

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

export function isEventAnnotationLayer(
  layer: AnnotationLayer,
): layer is EventAnnotationLayer {
  return layer.annotationType === AnnotationType.Event;
}
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 131..135
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 143..147
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 149..153
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 155..159

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

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

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

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

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

Refactorings

Further Reading

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

export function isTableAnnotationLayer(
  layer: AnnotationLayer,
): layer is TableAnnotationLayer {
  return layer.sourceType === AnnotationSourceType.Table;
}
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 131..135
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 137..141
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 143..147
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 149..153

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

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

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

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

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

Refactorings

Further Reading

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

export function isFormulaAnnotationLayer(
  layer: AnnotationLayer,
): layer is FormulaAnnotationLayer {
  return layer.annotationType === AnnotationType.Formula;
}
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 137..141
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 143..147
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 149..153
superset-frontend/packages/superset-ui-core/src/query/types/AnnotationLayer.ts on lines 155..159

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

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