airbnb/caravel

View on GitHub
superset-frontend/src/features/alerts/AlertReportModal.tsx

Summary

Maintainability
F
2 wks
Test Coverage

File AlertReportModal.tsx has 1500 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/alerts/AlertReportModal.tsx - About 4 days to fix

    Function AlertReportModal has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
    Open

    const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
      addDangerToast,
      onAdd,
      onHide,
      show,
    Severity: Minor
    Found in superset-frontend/src/features/alerts/AlertReportModal.tsx - About 2 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 onSave has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const onSave = () => {
        // Notification Settings
        const recipients: Recipient[] = [];
    
        notificationSettings.forEach(setting => {
    Severity: Major
    Found in superset-frontend/src/features/alerts/AlertReportModal.tsx - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

          if (resource) {
            // Add notification settings
            const settings = (resource.recipients || []).map(setting => {
              const config =
                typeof setting.recipient_config_json === 'string'
      Severity: Critical
      Found in superset-frontend/src/features/alerts/AlertReportModal.tsx - About 2 hrs to fix

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

          const loadChartOptions = useMemo(
            () =>
              (input = '', page: number, pageSize: number) => {
                const query = rison.encode_uri({
                  filter: input,
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 1 day to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 740..762
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 772..794

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

        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

          const loadDashboardOptions = useMemo(
            () =>
              (input = '', page: number, pageSize: number) => {
                const query = rison.encode_uri({
                  filter: input,
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 1 day to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 740..762
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 845..868

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

        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

          const loadSourceOptions = useMemo(
            () =>
              (input = '', page: number, pageSize: number) => {
                const query = rison.encode({
                  filter: input,
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 1 day to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 772..794
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 845..868

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

        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

                      <>
                        <div className="control-label">
                          {t('Select dashboard')}
                          <span className="required">*</span>
                        </div>
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 6 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1480..1500

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

        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

                      <>
                        <div className="control-label">
                          {t('Select chart')}
                          <span className="required">*</span>
                        </div>
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 6 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1502..1523

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

        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

          const getDashboardData = (db?: MetaObject) => {
            const dashboard = db || currentAlert?.dashboard;
        
            if (!dashboard || dashboard.label) {
              return null;
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 4 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 711..728
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 816..833

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

        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

            (chartData?: MetaObject) => {
              const chart = chartData || currentAlert?.chart;
        
              if (!chart || chart.label) {
                return null;
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 4 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 711..728
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 796..813

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

        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

            (db?: MetaObject) => {
              const database = db || currentAlert?.database;
        
              if (!database || database.label) {
                return null;
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 4 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 796..813
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 816..833

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

        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

                  <StyledInputContainer>
                    <div className="control-label">
                      {t('Timezone')} <span className="required">*</span>
                    </div>
                    <TimezoneSelector
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 2 hrs to fix
        superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx on lines 251..261

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

        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 StyledNotificationAddButton = styled.div`
          ${({ theme }) => css`
            color: ${theme.colors.primary.dark1};
            cursor: pointer;
        
        
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 2 hrs to fix
        superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx on lines 54..66

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

        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

                        <div className="input-container">
                          <NumberInput
                            min={1}
                            name="working_timeout"
                            value={currentAlert?.working_timeout || ''}
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 2 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1652..1661

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

        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

                        <div className="input-container">
                          <NumberInput
                            min={1}
                            name="grace_period"
                            value={currentAlert?.grace_period || ''}
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 2 hrs to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1638..1647

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

        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

                <StyledPanel
                  header={
                    <ValidatedPanelHeader
                      title={TRANSLATIONS.GENERAL_TITLE}
                      subtitle={t(
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 3 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1346..1446
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1586..1665
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1666..1700

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

        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

                  <StyledPanel
                    header={
                      <ValidatedPanelHeader
                        title={TRANSLATIONS.ALERT_CONDITION_TITLE}
                        subtitle={t(
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 3 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1262..1344
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1586..1665
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1666..1700

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

        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

                <StyledPanel
                  header={
                    <ValidatedPanelHeader
                      title={TRANSLATIONS.SCHEDULE_TITLE}
                      subtitle={t(
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 3 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1262..1344
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1346..1446
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1666..1700

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

        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

                <StyledPanel
                  header={
                    <ValidatedPanelHeader
                      title={TRANSLATIONS.NOTIFICATION_TITLE}
                      subtitle={t('Choose notification method and recipients.')}
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 3 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1262..1344
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1346..1446
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1586..1665

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

        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

                database: resource.database
                  ? getSourceData(resource.database) || {
                      value: (resource.database as DatabaseObject).id,
                      label: (resource.database as DatabaseObject).database_name,
                    }
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1157..1162
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1163..1168

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

        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

                chart: resource.chart
                  ? getChartData(resource.chart) || {
                      value: (resource.chart as ChartObject).id,
                      label: (resource.chart as ChartObject).slice_name,
                    }
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1163..1168
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1169..1174

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

        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

                dashboard: resource.dashboard
                  ? getDashboardData(resource.dashboard) || {
                      value: (resource.dashboard as DashboardObject).id,
                      label: (resource.dashboard as DashboardObject).dashboard_title,
                    }
        Severity: Major
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 2 other locations - About 1 hr to fix
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1157..1162
        superset-frontend/src/features/alerts/AlertReportModal.tsx on lines 1169..1174

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

        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

          ${({ theme }) => css`
            flex: 1;
            margin-top: 0px;
            margin-bottom: ${theme.gridUnit * 4}px;
        
        
        Severity: Minor
        Found in superset-frontend/src/features/alerts/AlertReportModal.tsx and 1 other location - About 35 mins to fix
        superset-frontend/src/components/Menu/index.tsx on lines 126..182

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

        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