airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

    def _export(
        model: SqlaTable, export_related: bool = True
    ) -> Iterator[tuple[str, Callable[[], str]]]:
        yield (
            ExportDatasetsCommand._file_name(model),
Severity: Minor
Found in superset/commands/dataset/export.py - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    def validate_report_frequency(
        self,
        cron_schedule: str,
        report_type: str,
    ) -> None:
Severity: Minor
Found in superset/commands/report/base.py - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

def populate_owner_list(
    owner_ids: list[int] | None,
    default_to_user: bool,
) -> list[User]:
    """
Severity: Minor
Found in superset/commands/utils.py - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    def __init__(  # pylint: disable=too-many-arguments
        self,
        sql: str,
        engine: Optional[str] = None,
        message: Optional[str] = None,
Severity: Minor
Found in superset/exceptions.py - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    def __init__(  # pylint: disable=too-many-arguments
Severity: Minor
Found in superset/commands/database/uploaders/base.py - About 45 mins to fix

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

        def has_guest_access(self, dashboard: "Dashboard") -> bool:
            user = self.get_current_guest_user_if_guest()
            if not user:
                return False
    
    
    Severity: Minor
    Found in superset/security/manager.py - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Avoid deeply nested control flow statements.
    Open

            if (!isNil(max)) {
              if (max < value) {
                max = value;
              }
            }
    Severity: Major
    Found in superset-frontend/plugins/plugin-chart-table/src/utils/extent.ts - About 45 mins to fix

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

          def is_mutating(self) -> bool:
              """
              Check if the statement mutates data (DDL/DML).
      
              :return: True if the statement mutates data.
      Severity: Minor
      Found in superset/sql/parse.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      export default function isEqualColumns(
        propsA: TableChartProps[],
        propsB: TableChartProps[],
      ) {
        const a = propsA[0];
      Severity: Minor
      Found in superset-frontend/plugins/plugin-chart-table/src/utils/isEqualColumns.ts - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        layer: FormulaAnnotationLayer,
        data: TimeseriesDataRecord[],
        xAxisCol: string,
        xAxisType: AxisType,
        colorScale: CategoricalColorScale,

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

        function formatValue(
          formatter: DataColumnMeta['formatter'],
          value: DataRecordValue,
        ): [boolean, string] {
          // render undefined as empty string
        Severity: Minor
        Found in superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Avoid deeply nested control flow statements.
        Open

                if (min > value) {
                  min = value;
                }
        Severity: Major
        Found in superset-frontend/plugins/plugin-chart-table/src/utils/extent.ts - About 45 mins to fix

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

              def split_script(
                  cls,
                  script: str,
                  engine: str,
              ) -> list[SQLStatement]:
          Severity: Minor
          Found in superset/sql/parse.py - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

            type: LegendType,
            orientation: LegendOrientation,
            show: boolean,
            theme: SupersetTheme,
            zoomable = false,
          Severity: Minor
          Found in superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts - About 45 mins to fix

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

                def get_datasources_accessible_by_user(  # pylint: disable=invalid-name
                    self,
                    database: "Database",
                    datasource_names: list[DatasourceName],
                    catalog: Optional[str] = None,
            Severity: Minor
            Found in superset/security/manager.py - About 45 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

              layer: EventAnnotationLayer,
              data: TimeseriesDataRecord[],
              annotationData: AnnotationData,
              colorScale: CategoricalColorScale,
              theme: SupersetTheme,

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

                (
                  groupby: (BaseTransformedProps<any> &
                    CrossFilterTransformedProps)['groupby'],
                  onContextMenu: BaseTransformedProps<any>['onContextMenu'],
                  labelMap: Record<string, string[]>,

              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 useExtraControl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              export function useExtraControl<
                F extends {
                  stack: any;
                  area: boolean;
                },

              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 getLayer has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                formData: PolygonFormData,
                payload: JsonObject,
                onAddFilter: HandlerFunction,
                setTooltip: (tooltip: TooltipProps['tooltip']) => void,
                selected: JsonObject[],

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

                  layer: IntervalAnnotationLayer,
                  data: TimeseriesDataRecord[],
                  annotationData: AnnotationData,
                  colorScale: CategoricalColorScale,
                  theme: SupersetTheme,
                  Severity
                  Category
                  Status
                  Source
                  Language