airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function send_email_smtp has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

def send_email_smtp(  # pylint: disable=invalid-name,too-many-arguments,too-many-locals
Severity: Major
Found in superset/utils/core.py - About 1 hr to fix

    Function cache_key has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def cache_key(self, **extra: Any) -> str:
            """
            The cache key is made out of the key/values from to_dict(), plus any
            other key/values in `extra`
            We remove datetime bounds that are hard values, and replace them with
    Severity: Minor
    Found in superset/common/query_object.py - About 1 hr 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_data has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_data(self, df: pd.DataFrame) -> VizData:
            comparison_type = self.form_data.get("comparison_type") or "values"
            df = self.process_data(df)
            if comparison_type == "values":
                # Filter out series with all NaN
    Severity: Minor
    Found in superset/viz.py - About 1 hr 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_parameters has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate_parameters(
            cls,
            properties: GSheetsPropertiesType,
        ) -> list[SupersetError]:
            errors: list[SupersetError] = []
    Severity: Minor
    Found in superset/db_engine_specs/gsheets.py - About 1 hr 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 14 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in superset/common/utils/query_cache_manager.py - About 1 hr to fix

      Function _adjust_string_with_rls has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def _adjust_string_with_rls(
          unique_string: str,
          datasources: list[SqlaTable | None] | set[BaseDatasource],
          executor: str,
      ) -> str:
      Severity: Minor
      Found in superset/thumbnails/digest.py - About 1 hr 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_catalogs_accessible_by_user has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_catalogs_accessible_by_user(
              self,
              database: "Database",
              catalogs: set[str],
              hierarchical: bool = True,
      Severity: Minor
      Found in superset/security/manager.py - About 1 hr 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 getCrossFilterDataMask has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        (
          selectedValues: Record<number, string>,
          groupby: QueryFormColumn[],
          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 formatForecastTooltipSeries has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export const formatForecastTooltipSeries = ({
        seriesName,
        observation,
        forecastTrend,
        forecastLower,

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

      export default function buildQuery(formData: QueryFormData) {
        const { cols: groupby } = formData;
      
        const queryContextA = buildQueryContext(formData, baseQueryObject => {
          const postProcessing: PostProcessingRule[] = [];

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

      export function getBreakPoints(
        {
          break_points: formDataBreakPoints,
          num_buckets: formDataNumBuckets,
        }: Buckets,
      Severity: Minor
      Found in superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils.ts - About 1 hr 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 DndLabelsContainer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        ${({ theme, isLoading, canDrop, isDragging, isOver }) => `
        position: relative;
        padding: ${theme.gridUnit}px;
        border: ${
          !isLoading && isDragging

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

      export function useKeywords(
        { queryEditorId, dbId, catalog, schema }: Params,
        skip = false,
      ) {
        const useCustomKeywords = extensionsRegistry.get(

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

      export default function chartReducer(
        charts: Record<string, ChartState> = {},
        action: AnyChartAction,
      ) {
        const actionHandlers: Record<string, ChartActionHandler> = {
      Severity: Minor
      Found in superset-frontend/src/components/Chart/chartReducer.ts - About 1 hr 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 ListView has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function ListView<T extends object = any>({
        columns,
        data,
        count,
        pageSize: initialPageSize,
      Severity: Minor
      Found in superset-frontend/src/components/ListView/ListView.tsx - About 1 hr 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 DrillByModal has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function DrillByModal({
        column,
        dataset,
        drillByConfig,
        formData,
      Severity: Minor
      Found in superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx - About 1 hr 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 handleDropdownNavigation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export const handleDropdownNavigation = (
        e: KeyboardEvent<HTMLElement>,
        dropdownIsOpen: boolean,
        menu: ReactElement,
        toggleDropdown: () => void,

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

      export async function embedDashboard({
        id,
        supersetDomain,
        mountPoint,
        fetchGuestToken,
      Severity: Minor
      Found in superset-embedded-sdk/src/index.ts - About 1 hr 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 render has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { adhocFilter, height, options } = this.props;
      
          const keywords = sqlKeywords.concat(
            getColumnKeywords(options.filter(option => option.column_name)),

        Function onUpdateSuccess has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            const onUpdateSuccess = response => {
              const updatedDashboard = response.json.result;
              const lastModifiedTime = response.json.last_modified_time;
              // syncing with the backend transformations of the metadata
              if (updatedDashboard.json_metadata) {
        Severity: Minor
        Found in superset-frontend/src/dashboard/actions/dashboardState.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language