airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function getRowsWithRoles has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const getRowsWithRoles = () => {
    const jsonMetadataObj = getJsonMetadata();
    const hasCustomLabelsColor = !!Object.keys(
      jsonMetadataObj?.label_colors || {},
    ).length;
Severity: Major
Found in superset-frontend/src/dashboard/components/PropertiesModal/index.tsx - About 2 hrs to fix

    File controlPanel.tsx has 276 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

      Function transformProps has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function transformProps(chartProps) {
        const { width, height, formData, hooks, queriesData } = chartProps;
        const { onError = NOOP, setControlValue = NOOP } = hooks;
        const { bounds, geoJSON, hasCustomMetric, mapboxApiKey } =
          queriesData[0].data;

        File native_filters.py has 275 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
        # to you under the Apache License, Version 2.0 (the
        Severity: Minor
        Found in superset/migrations/shared/native_filters.py - About 2 hrs to fix

          File ocient.py has 275 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
          # to you under the Apache License, Version 2.0 (the
          Severity: Minor
          Found in superset/db_engine_specs/ocient.py - About 2 hrs to fix

            File v0.py has 275 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
            # to you under the Apache License, Version 2.0 (the
            Severity: Minor
            Found in superset/commands/dashboard/importers/v0.py - About 2 hrs to fix

              File transformProps.ts has 275 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

                Function createQuerySection has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createQuerySection(
                  label: string,
                  controlSuffix: string,
                ): ControlPanelSectionConfig {
                  return {

                  Function useAdvancedDataTypes has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const useAdvancedDataTypes = (validHandler: (isValid: boolean) => void) => {
                    const [advancedDataTypesState, setAdvancedDataTypesState] =
                      useState<AdvancedDataTypesState>(INITIAL_ADVANCED_DATA_TYPES_STATE);
                    const [subjectAdvancedDataType, setSubjectAdvancedDataType] = useState<
                      string | undefined

                    Function ColumnCollectionTable has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function ColumnCollectionTable({
                      columns,
                      datasource,
                      onColumnsChange,
                      onDatasourceChange,
                    Severity: Minor
                    Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 2 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 getExploreUrl has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function getExploreUrl({
                      formData,
                      endpointType = 'base',
                      force = false,
                      curUrl = null,
                    Severity: Minor
                    Found in superset-frontend/src/explore/exploreUtils/index.js - About 2 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 _get_sqla_engine has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _get_sqla_engine(  # pylint: disable=too-many-locals
                            self,
                            catalog: str | None = None,
                            schema: str | None = None,
                            nullpool: bool = True,
                    Severity: Minor
                    Found in superset/models/core.py - About 2 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 get_column_groups has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def get_column_groups(
                        df: DataFrame, time_shifts: list[str] | None, rename_columns: list[str]
                    ) -> dict[str, Any]:
                        """
                        Group columns based on whether they have a time shift.
                    Severity: Minor
                    Found in superset/utils/pandas_postprocessing/contribution.py - About 2 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 extract_dataframe_dtypes has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def extract_dataframe_dtypes(
                        df: pd.DataFrame,
                        datasource: BaseDatasource | Query | None = None,
                    ) -> list[GenericDataType]:
                        """Serialize pandas/numpy dtypes to generic types"""
                    Severity: Minor
                    Found in superset/utils/core.py - About 2 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 sanitize_clause has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def sanitize_clause(clause: str) -> str:
                        # clause = sqlparse.format(clause, strip_comments=True)
                        statements = sqlparse.parse(clause)
                        if len(statements) != 1:
                            raise QueryClauseValidationException("Clause contains multiple statements")
                    Severity: Minor
                    Found in superset/sql_parse.py - About 2 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 query_context_modified has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def query_context_modified(query_context: "QueryContext") -> bool:
                        """
                        Check if a query context has been modified.
                    
                        This is used to ensure guest users don't modify the payload and fetch data
                    Severity: Minor
                    Found in superset/security/manager.py - About 2 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 get_filters has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_filters(self, column: str, remove_filter: bool = False) -> list[Filter]:
                            """Get the filters applied to the given column. In addition
                               to returning values like the filter_values function
                               the get_filters function returns the operator specified in the explorer UI.
                    
                    
                    Severity: Minor
                    Found in superset/jinja_context.py - About 2 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 isControlValueCompatibleWithDatasource has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const isControlValueCompatibleWithDatasource = (
                      datasource: Dataset,
                      controlState: ControlState,
                      value: any,
                    ) => {

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

                    const SqlEditorLeftBar = ({
                      database,
                      queryEditorId,
                      height = 500,
                    }: SqlEditorLeftBarProps) => {
                    Severity: Minor
                    Found in superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx - About 2 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 testWithId has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                      <T extends string | JsonObject = JsonObject>(
                        prefix?: string,
                        idOnly = false,
                      ) =>
                      (id?: string, localIdOnly = false): TestWithIdType<T> => {
                    Severity: Minor
                    Found in superset-frontend/src/utils/testUtils.ts - About 2 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

                    Severity
                    Category
                    Status
                    Source
                    Language