airbnb/caravel

View on GitHub
superset-frontend/src/views/CRUD/utils.tsx

Summary

Maintainability
F
5 days
Test Coverage

File utils.tsx has 495 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
Severity: Minor
Found in superset-frontend/src/views/CRUD/utils.tsx - About 7 hrs to fix

    Function getFilterValues has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function getFilterValues(
      tab: TableTab,
      welcomeTable: WelcomeTable,
      user?: User,
      otherTabFilters?: Filter[],
    Severity: Major
    Found in superset-frontend/src/views/CRUD/utils.tsx - About 2 hrs to fix

      Function createFetchResourceMethod has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async (filterValue = '', page: number, pageSize: number) => {
          const resourceEndpoint = `/api/v1/${resource}/${method}/${relation}`;
          const queryParams = rison.encode_uri({
            filter: filterValue,
            page,
      Severity: Minor
      Found in superset-frontend/src/views/CRUD/utils.tsx - About 1 hr to fix

        Function getEditedObjects has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getEditedObjects = (userId: string | number) => {
          const filters = {
            edited: [
              {
                col: 'changed_by',
        Severity: Minor
        Found in superset-frontend/src/views/CRUD/utils.tsx - About 1 hr to fix

          Function getFilterValues has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          export function getFilterValues(
            tab: TableTab,
            welcomeTable: WelcomeTable,
            user?: User,
            otherTabFilters?: Filter[],
          Severity: Minor
          Found in superset-frontend/src/views/CRUD/utils.tsx - About 55 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function handleChartDelete has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            { id, slice_name: sliceName }: Chart,
            addSuccessToast: (arg0: string) => void,
            addDangerToast: (arg0: string) => void,
            refreshData: (arg0?: FetchDataConfig | null) => void,
            chartFilter?: string,
          Severity: Minor
          Found in superset-frontend/src/views/CRUD/utils.tsx - About 45 mins to fix

            Function createFetchResourceMethod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              (method: string) =>
              (
                resource: string,
                relation: string,
                handleError: (error: Response) => void,
            Severity: Minor
            Found in superset-frontend/src/views/CRUD/utils.tsx - About 45 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

            Function handleDashboardDelete has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              { id, dashboard_title: dashboardTitle }: Dashboard,
              refreshData: (config?: FetchDataConfig | null) => void,
              addSuccessToast: (arg0: string) => void,
              addDangerToast: (arg0: string) => void,
              dashboardFilter?: string,
            Severity: Minor
            Found in superset-frontend/src/views/CRUD/utils.tsx - About 45 mins to fix

              Avoid too many return statements within this function.
              Open

                  return (otherTabFilters || []).map(flt => ({
                    id: flt.col,
                    operator: flt.opr,
                    value: flt.value,
                  }));
              Severity: Major
              Found in superset-frontend/src/views/CRUD/utils.tsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return [];
                Severity: Major
                Found in superset-frontend/src/views/CRUD/utils.tsx - About 30 mins to fix

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

                  export const getSSHPasswordsNeeded = (errors: Record<string, any>[]) =>
                    errors
                      .map(error =>
                        Object.entries(error.extra)
                          .filter(([, payload]) => isNeedsSSHPassword(payload))
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 4 other locations - About 2 hrs to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 407..414
                  superset-frontend/src/views/CRUD/utils.tsx on lines 425..432
                  superset-frontend/src/views/CRUD/utils.tsx on lines 434..443
                  superset-frontend/src/views/CRUD/utils.tsx on lines 445..452

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

                  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 getSSHPrivateKeyPasswordsNeeded = (
                    errors: Record<string, any>[],
                  ) =>
                    errors
                      .map(error =>
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 4 other locations - About 2 hrs to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 407..414
                  superset-frontend/src/views/CRUD/utils.tsx on lines 416..423
                  superset-frontend/src/views/CRUD/utils.tsx on lines 425..432
                  superset-frontend/src/views/CRUD/utils.tsx on lines 445..452

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

                  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 getSSHPrivateKeysNeeded = (errors: Record<string, any>[]) =>
                    errors
                      .map(error =>
                        Object.entries(error.extra)
                          .filter(([, payload]) => isNeedsSSHPrivateKey(payload))
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 4 other locations - About 2 hrs to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 407..414
                  superset-frontend/src/views/CRUD/utils.tsx on lines 416..423
                  superset-frontend/src/views/CRUD/utils.tsx on lines 434..443
                  superset-frontend/src/views/CRUD/utils.tsx on lines 445..452

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

                  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 getPasswordsNeeded = (errors: Record<string, any>[]) =>
                    errors
                      .map(error =>
                        Object.entries(error.extra)
                          .filter(([, payload]) => isNeedsPassword(payload))
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 4 other locations - About 2 hrs to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 416..423
                  superset-frontend/src/views/CRUD/utils.tsx on lines 425..432
                  superset-frontend/src/views/CRUD/utils.tsx on lines 434..443
                  superset-frontend/src/views/CRUD/utils.tsx on lines 445..452

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

                  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 getAlreadyExists = (errors: Record<string, any>[]) =>
                    errors
                      .map(error =>
                        Object.entries(error.extra)
                          .filter(([, payload]) => isAlreadyExists(payload))
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 4 other locations - About 2 hrs to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 407..414
                  superset-frontend/src/views/CRUD/utils.tsx on lines 416..423
                  superset-frontend/src/views/CRUD/utils.tsx on lines 425..432
                  superset-frontend/src/views/CRUD/utils.tsx on lines 434..443

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

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

                  export /* eslint-disable no-underscore-dangle */
                  const isNeedsSSHPrivateKey = (payload: any) =>
                    typeof payload === 'object' &&
                    Array.isArray(payload._schema) &&
                    !!payload._schema?.find(
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 3 other locations - About 1 hr to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 370..376
                  superset-frontend/src/views/CRUD/utils.tsx on lines 378..384
                  superset-frontend/src/views/CRUD/utils.tsx on lines 394..401

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

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

                  export /* eslint-disable no-underscore-dangle */
                  const isNeedsPassword = (payload: any) =>
                    typeof payload === 'object' &&
                    Array.isArray(payload._schema) &&
                    !!payload._schema?.find(
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 3 other locations - About 1 hr to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 378..384
                  superset-frontend/src/views/CRUD/utils.tsx on lines 386..392
                  superset-frontend/src/views/CRUD/utils.tsx on lines 394..401

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

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

                  export /* eslint-disable no-underscore-dangle */
                  const isNeedsSSHPrivateKeyPassword = (payload: any) =>
                    typeof payload === 'object' &&
                    Array.isArray(payload._schema) &&
                    !!payload._schema?.find(
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 3 other locations - About 1 hr to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 370..376
                  superset-frontend/src/views/CRUD/utils.tsx on lines 378..384
                  superset-frontend/src/views/CRUD/utils.tsx on lines 386..392

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

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

                  export /* eslint-disable no-underscore-dangle */
                  const isNeedsSSHPassword = (payload: any) =>
                    typeof payload === 'object' &&
                    Array.isArray(payload._schema) &&
                    !!payload._schema?.find(
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 3 other locations - About 1 hr to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 370..376
                  superset-frontend/src/views/CRUD/utils.tsx on lines 386..392
                  superset-frontend/src/views/CRUD/utils.tsx on lines 394..401

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

                  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

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

                        showThumbnails
                          ? `${theme.gridUnit * 8 + 3}px ${theme.gridUnit * 9}px`
                          : `${theme.gridUnit * 8 + 1}px ${theme.gridUnit * 9}px`
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 1 other location - About 1 hr to fix
                  superset-frontend/src/components/ListView/CardCollection.tsx on lines 40..42

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

                  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 filters = {
                          pageIndex: 0,
                          pageSize: PAGE_SIZE,
                          sortBy: [
                            {
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 1 other location - About 1 hr to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 249..265

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

                  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 filters = {
                      pageIndex: 0,
                      pageSize: PAGE_SIZE,
                      sortBy: [
                        {
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 1 other location - About 1 hr to fix
                  superset-frontend/src/views/CRUD/utils.tsx on lines 292..308

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  export const StyledIcon = (theme: SupersetTheme) => css`
                    margin: auto ${theme.gridUnit * 2}px auto 0;
                    color: ${theme.colors.grayscale.base};
                  `;
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 2 other locations - About 55 mins to fix
                  superset-frontend/src/components/MessageToasts/Toast.tsx on lines 36..39
                  superset-frontend/src/features/rls/RowLevelSecurityModal.tsx on lines 57..60

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

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

                  export const Actions = styled.div`
                    color: ${({ theme }) => theme.colors.grayscale.base};
                  `;
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/utils.tsx and 6 other locations - About 40 mins to fix
                  superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx on lines 25..33
                  superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts on lines 86..88
                  superset-frontend/src/explore/components/controls/OptionControls/index.tsx on lines 77..81
                  superset-frontend/src/features/datasets/styles.ts on lines 21..26
                  superset-frontend/src/features/datasets/styles.ts on lines 120..132
                  superset-frontend/src/features/reports/ReportModal/styles.tsx on lines 77..79

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

                  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