airbnb/superset

View on GitHub
superset-frontend/src/features/databases/DatabaseModal/index.tsx

Summary

Maintainability
F
3 wks
Test Coverage

File index.tsx has 1868 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: Major
Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 5 days to fix

    Function DatabaseModal has a Cognitive Complexity of 178 (exceeds 5 allowed). Consider refactoring.
    Open

    const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
      addDangerToast,
      addSuccessToast,
      onDatabaseAdd,
      onHide,
    Severity: Minor
    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 3 days 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 dbReducer has 259 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function dbReducer(
      state: Partial<DatabaseObject> | null,
      action: DBReducerActionType,
    ): Partial<DatabaseObject> | null {
      const trimmedState = {
    Severity: Major
    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 day to fix

      Function onSave has 147 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const onSave = async () => {
          let dbConfigExtraExtensionOnSaveError;
      
          setLoading(true);
      
      
      Severity: Major
      Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 5 hrs to fix

        Function dbReducer has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        export function dbReducer(
          state: Partial<DatabaseObject> | null,
          action: DBReducerActionType,
        ): Partial<DatabaseObject> | null {
          const trimmedState = {
        Severity: Minor
        Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function passwordNeededField has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const passwordNeededField = () => {
            if (
              !passwordFields.length &&
              !sshTunnelPasswordFields.length &&
              !sshTunnelPrivateKeyFields.length &&
        Severity: Major
        Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 4 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if (
                importLoading ||
                (alreadyExists.length && !confirmedOverwrite) ||
                (passwordsNeeded.length && JSON.stringify(passwords) === '{}') ||
                (sshPasswordNeeded.length &&
          Severity: Critical
          Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 2 hrs to fix

            Function renderModalFooter has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const renderModalFooter = () => {
                if (db) {
                  // if db show back + connect
                  if (!hasConnectedDb || editNewDb) {
                    return (
            Severity: Major
            Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 2 hrs to fix

              Function setDatabaseModel has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const setDatabaseModel = (database_name: string) => {
                  if (database_name === 'Other') {
                    // Allow users to connect to DB via legacy SQLA form
                    setDB({
                      type: ActionType.DbSelected,
              Severity: Minor
              Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                Function renderFinishState has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const renderFinishState = () => {
                    if (!editNewDb) {
                      return (
                        <ExtraOptions
                          extraExtension={dbConfigExtraExtension}
                Severity: Minor
                Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (
                        !importLoading &&
                        !alreadyExists.length &&
                        !passwordsNeeded.length &&
                        !sshPasswordNeeded.length &&
                  Severity: Critical
                  Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                    Function testConnection has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const testConnection = () => {
                        if (!db?.sqlalchemy_uri) {
                          addDangerToast(t('Please enter a SQLAlchemy URI to test'));
                          return;
                        }
                    Severity: Minor
                    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                      Function errorAlert has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const errorAlert = () => {
                          let alertErrors: string[] = [];
                          if (!isEmpty(dbErrors)) {
                            alertErrors =
                              typeof dbErrors === 'object'
                      Severity: Minor
                      Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                        Function renderStepTwoAlert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const renderStepTwoAlert = () => {
                            const { hostname } = window.location;
                            let ipAlert = connectionAlert?.REGIONAL_IPS?.default || '';
                            const regionalIPs = connectionAlert?.REGIONAL_IPS || {};
                            Object.entries(regionalIPs).forEach(([ipRegion, ipRange]) => {
                        Severity: Minor
                        Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                          Function confirmOverwriteField has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const confirmOverwriteField = () => {
                              if (!alreadyExists.length) return null;
                          
                              return (
                                <>
                          Severity: Minor
                          Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

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

                              const onDbImport = async (info: UploadChangeParam) => {
                                setImportingErrorMessage('');
                                setPasswordFields([]);
                                setSSHTunnelPasswordFields([]);
                                setSSHTunnelPrivateKeyFields([]);
                            Severity: Minor
                            Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                    if (
                                      action.payload.masked_encrypted_extra &&
                                      action.payload.configuration_method === ConfigurationMethod.DynamicForm
                                    ) {
                                      // "extra" payload from the api is a string
                              Severity: Major
                              Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                  if (
                                    fileList.length > 0 &&
                                    (alreadyExists.length ||
                                      passwordFields.length ||
                                      sshTunnelPasswordFields.length ||
                                Severity: Major
                                Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 40 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return {
                                            ...trimmedState,
                                            ssh_tunnel: {
                                              password: trimmedState?.ssh_tunnel?.password,
                                              ...ssh_tunnel,
                                  Severity: Major
                                  Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return {
                                              ...trimmedState,
                                              catalog: [...trimmedState.catalog, { name: '', value: '' }],
                                            };
                                    Severity: Major
                                    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return {
                                                ...trimmedState,
                                                extra: JSON.stringify({
                                                  ...extraJson,
                                                  schema_options: {
                                      Severity: Major
                                      Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                              return {
                                                ...trimmedState,
                                                parameters: {
                                                  ...trimmedState.parameters,
                                                  [action.payload.name]: action.payload.value,
                                        Severity: Major
                                        Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                return {
                                                  ...trimmedState,
                                                };
                                          Severity: Major
                                          Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                  return {
                                                    ...trimmedState,
                                                    extra: JSON.stringify({
                                                      ...extraJson,
                                                      [action.payload.name]:
                                            Severity: Major
                                            Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                    return {
                                                      ...action.payload,
                                                      masked_encrypted_extra: action.payload.masked_encrypted_extra || '',
                                                      engine: action.payload.backend || trimmedState.engine,
                                                      configuration_method: action.payload.configuration_method,
                                              Severity: Major
                                              Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return {
                                                          ...trimmedState,
                                                          catalog: catalogCopy,
                                                          parameters: {
                                                            ...trimmedState.parameters,
                                                Severity: Major
                                                Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                        return {
                                                          ...trimmedState,
                                                        };
                                                  Severity: Major
                                                  Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                          return {
                                                            ...trimmedState,
                                                            catalog: [{ name: '', value: '' }],
                                                          };
                                                    Severity: Major
                                                    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                            return {
                                                              ...trimmedState,
                                                              [action.payload.name]: action.payload.value,
                                                            };
                                                      Severity: Major
                                                      Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                return {
                                                                  ...trimmedState,
                                                                  ssh_tunnel: {
                                                                    private_key: trimmedState?.ssh_tunnel?.private_key,
                                                                    private_key_password:
                                                        Severity: Major
                                                        Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return {
                                                                    ...trimmedState,
                                                                    [action.payload.name]: action.payload.checked,
                                                                  };
                                                          Severity: Major
                                                          Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                    return {
                                                                      ...action.payload,
                                                                      engine: action.payload.backend || trimmedState.engine,
                                                                      configuration_method: action.payload.configuration_method,
                                                                      catalog: engineRootCatalog,
                                                            Severity: Major
                                                            Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return;
                                                              Severity: Major
                                                              Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 30 mins to fix

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

                                                                        {sshTunnelPrivateKeyPasswordFields?.indexOf(database) >= 0 && (
                                                                          <ValidatedInput
                                                                            id="ssh_tunnel_private_key_password_needed"
                                                                            name="ssh_tunnel_private_key_password_needed"
                                                                            required
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1379..1393
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1394..1411
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1412..1429

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

                                                                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

                                                                        {passwordFields?.indexOf(database) >= 0 && (
                                                                          <ValidatedInput
                                                                            id="password_needed"
                                                                            name="password_needed"
                                                                            required
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1394..1411
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1412..1429
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1430..1449

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

                                                                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

                                                                        {sshTunnelPasswordFields?.indexOf(database) >= 0 && (
                                                                          <ValidatedInput
                                                                            id="ssh_tunnel_password_needed"
                                                                            name="ssh_tunnel_password_needed"
                                                                            required
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1379..1393
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1412..1429
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1430..1449

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

                                                                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

                                                                        {sshTunnelPrivateKeyFields?.indexOf(database) >= 0 && (
                                                                          <ValidatedInput
                                                                            id="ssh_tunnel_private_key_needed"
                                                                            name="ssh_tunnel_private_key_needed"
                                                                            required
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1379..1393
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1394..1411
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1430..1449

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

                                                                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

                                                                          onExtraInputChange={({ target }: { target: HTMLInputElement }) => {
                                                                            onChange(ActionType.ExtraInputChange, {
                                                                              type: target.type,
                                                                              name: target.name,
                                                                              checked: target.checked,
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1901..1908

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

                                                                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

                                                                            onExtraInputChange={({ target }: { target: HTMLInputElement }) => {
                                                                              onChange(ActionType.ExtraInputChange, {
                                                                                type: target.type,
                                                                                name: target.name,
                                                                                checked: target.checked,
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1691..1698

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

                                                                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

                                                                                onInputChange={({ target }: { target: HTMLInputElement }) =>
                                                                                  onChange(ActionType.InputChange, {
                                                                                    type: target.type,
                                                                                    name: target.name,
                                                                                    checked: target.checked,
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1674..1681
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1884..1891

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

                                                                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

                                                                          onInputChange={({ target }: { target: HTMLInputElement }) =>
                                                                            onChange(ActionType.InputChange, {
                                                                              type: target.type,
                                                                              name: target.name,
                                                                              checked: target.checked,
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1799..1806
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1884..1891

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

                                                                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

                                                                            onInputChange={({ target }: { target: HTMLInputElement }) =>
                                                                              onChange(ActionType.InputChange, {
                                                                                type: target.type,
                                                                                name: target.name,
                                                                                checked: target.checked,
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1674..1681
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1799..1806

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

                                                                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 confirmOverwrite = (event: React.ChangeEvent<HTMLInputElement>) => {
                                                                    const targetValue = (event.currentTarget?.value as string) ?? '';
                                                                    setConfirmedOverwrite(targetValue.toUpperCase() === t('OVERWRITE'));
                                                                  };
                                                                superset-frontend/src/components/ImportModal/index.tsx on lines 265..268

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

                                                                        dbConfigExtraExtension
                                                                          ?.onSave(extraExtensionComponentState, db)
                                                                          .then(({ error }: { error: any }) => {
                                                                            if (error) {
                                                                              dbConfigExtraExtensionOnSaveError = error;
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 763..770
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 894..901

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

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

                                                                        dbConfigExtraExtension
                                                                          ?.onSave(extraExtensionComponentState, db)
                                                                          .then(({ error }: { error: any }) => {
                                                                            if (error) {
                                                                              dbConfigExtraExtensionOnSaveError = error;
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 763..770
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 868..875

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

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

                                                                    dbConfigExtraExtension
                                                                      ?.onSave(extraExtensionComponentState, db)
                                                                      .then(({ error }: { error: any }) => {
                                                                        if (error) {
                                                                          dbConfigExtraExtensionOnSaveError = error;
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 868..875
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 894..901

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

                                                                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

                                                                    if (dbToUpdate?.parameters?.catalog) {
                                                                      // need to stringify gsheets catalog to allow it to be serialized
                                                                      dbToUpdate.extra = JSON.stringify({
                                                                        ...JSON.parse(dbToUpdate.extra || '{}'),
                                                                        engine_params: {
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 781..789

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

                                                                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

                                                                      if (dbToUpdate?.parameters?.catalog) {
                                                                        // need to stringify gsheets catalog to allow it to be serialized
                                                                        dbToUpdate.extra = JSON.stringify({
                                                                          ...JSON.parse(dbToUpdate.extra || '{}'),
                                                                          engine_params: {
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 844..852

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

                                                                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

                                                                const ErrorAlertContainer = styled.div`
                                                                  ${({ theme }) => `
                                                                    margin: ${theme.gridUnit * 8}px ${theme.gridUnit * 4}px;
                                                                  `};
                                                                `;
                                                                superset-frontend/src/components/Datasource/CollectionTable.tsx on lines 145..150
                                                                superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx on lines 50..64
                                                                superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx on lines 89..104
                                                                superset-frontend/src/features/datasets/AddDataset/EditDataset/index.tsx on lines 38..45
                                                                superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx on lines 53..61
                                                                superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx on lines 63..71

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

                                                                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

                                                                          <ModalHeader
                                                                            isLoading={isLoading}
                                                                            isEditMode={isEditMode}
                                                                            useSqlAlchemyForm={useSqlAlchemyForm}
                                                                            hasConnectedDb={hasConnectedDb}
                                                                superset-frontend/src/components/TableView/TableView.tsx on lines 211..220
                                                                superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.tsx on lines 312..321
                                                                superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx on lines 347..356
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1734..1743

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

                                                                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

                                                                        <ModalHeader
                                                                          isLoading={isLoading}
                                                                          isEditMode={isEditMode}
                                                                          useSqlAlchemyForm={useSqlAlchemyForm}
                                                                          hasConnectedDb={hasConnectedDb}
                                                                superset-frontend/src/components/TableView/TableView.tsx on lines 211..220
                                                                superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.tsx on lines 312..321
                                                                superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx on lines 347..356
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1936..1945

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

                                                                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

                                                                          onTextChange={({ target }: { target: HTMLTextAreaElement }) =>
                                                                            onChange(ActionType.TextChange, {
                                                                              name: target.name,
                                                                              value: target.value,
                                                                            })
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1632..1637
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1638..1643
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1651..1656
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1892..1897

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

                                                                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

                                                                            onTextChange={({ target }: { target: HTMLTextAreaElement }) =>
                                                                              onChange(ActionType.TextChange, {
                                                                                name: target.name,
                                                                                value: target.value,
                                                                              })
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1632..1637
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1638..1643
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1651..1656
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1682..1687

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

                                                                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

                                                                        onChange={({ target }: { target: HTMLInputElement }) =>
                                                                          onChange(ActionType.TextChange, {
                                                                            name: target.name,
                                                                            value: target.value,
                                                                          })
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1632..1637
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1638..1643
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1682..1687
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1892..1897

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

                                                                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

                                                                        onQueryChange={({ target }: { target: HTMLInputElement }) =>
                                                                          onChange(ActionType.QueryChange, {
                                                                            name: target.name,
                                                                            value: target.value,
                                                                          })
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1638..1643
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1651..1656
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1682..1687
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1892..1897

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

                                                                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

                                                                        onExtraInputChange={({ target }: { target: HTMLInputElement }) =>
                                                                          onChange(ActionType.ExtraInputChange, {
                                                                            name: target.name,
                                                                            value: target.value,
                                                                          })
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1632..1637
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1651..1656
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1682..1687
                                                                superset-frontend/src/features/databases/DatabaseModal/index.tsx on lines 1892..1897

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

                                                                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

                                                                  const removeFile = (removedFile: UploadFile) => {
                                                                    setFileList(fileList.filter(file => file.uid !== removedFile.uid));
                                                                    return false;
                                                                  };
                                                                superset-frontend/src/components/ImportModal/index.tsx on lines 260..263

                                                                Duplicated Code

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

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

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

                                                                Tuning

                                                                This issue has a mass of 53.

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

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

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

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

                                                                Refactorings

                                                                Further Reading

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

                                                                const SSHTunnelContainer = styled.div`
                                                                  ${({ theme }) => `
                                                                    padding: 0px ${theme.gridUnit * 4}px;
                                                                  `};
                                                                `;
                                                                superset-frontend/src/components/Datasource/CollectionTable.tsx on lines 140..143
                                                                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 110..117
                                                                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 34..36
                                                                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

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status