airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

  layer: TimeseriesAnnotationLayer,
  markerSize: number,
  data: TimeseriesDataRecord[],
  annotationData: AnnotationData,
  colorScale: CategoricalColorScale,

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

    export const waitForAsyncData = async (asyncResponse: AsyncEvent) =>
      new Promise((resolve, reject) => {
        const jobId = asyncResponse.job_id;
        const listener = async (asyncEvent: AsyncEvent) => {
          switch (asyncEvent.status) {
    Severity: Minor
    Found in superset-frontend/src/middleware/asyncEvent.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 translateToSql has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const translateToSql = (
      adhocFilter: AdhocFilter,
      { useSimple }: { useSimple: boolean } = { useSimple: false },
    ) => {
      if (isSimpleAdhocFilter(adhocFilter) || useSimple) {

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

    export default function ColorSchemeLabel(props: ColorSchemeLabelProps) {
      const { id, label, colors } = props;
      const [showTooltip, setShowTooltip] = useState<boolean>(false);
      const labelNameRef = useRef<HTMLElement>(null);
      const labelsColorRef = useRef<HTMLElement>(null);

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

    export const ComparisonRangeLabel = ({
      multi = true,
    }: ComparisonRangeLabelProps) => {
      const [labels, setLabels] = useState<string[]>([]);
      const currentTimeRangeFilters = useSelector<RootState, BinaryAdhocFilter[]>(

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

    export const VizTile = ({
      isActive,
      isRendered,
      vizMeta,
      onTileClick,

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

      { id, slice_name: sliceName }: Chart,
      addSuccessToast: (arg0: string) => void,
      addDangerToast: (arg0: string) => void,
      refreshData: (arg0?: FetchDataConfig | null) => void,
      chartFilter?: string,
    Severity: Minor
    Found in superset-frontend/src/views/CRUD/utils.tsx - About 45 mins to fix

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

        (method: string) =>
        (
          resource: string,
          relation: string,
          handleError: (error: Response) => void,
      Severity: Minor
      Found in superset-frontend/src/views/CRUD/utils.tsx - 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 (databases[db].database_name === databaseName) {
                      databaseId = databases[db].id;
                    }
      Severity: Major
      Found in superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx - About 45 mins to fix

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

        const ColumnSelectPopoverTrigger = ({
          columns,
          editedColumn,
          onColumnEdit,
          isControlledComponent,

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

          { id, dashboard_title: dashboardTitle }: Dashboard,
          refreshData: (config?: FetchDataConfig | null) => void,
          addSuccessToast: (arg0: string) => void,
          addDangerToast: (arg0: string) => void,
          dashboardFilter?: string,
        Severity: Minor
        Found in superset-frontend/src/views/CRUD/utils.tsx - About 45 mins to fix

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

          export const renderSelectOptions = (options: SelectOptionsType) =>
            options.map(opt => {
              const isOptObject = typeof opt === 'object';
              const label = isOptObject ? opt?.label || opt.value : opt;
              const value = isOptObject ? opt.value : opt;
          Severity: Minor
          Found in superset-frontend/src/components/Select/utils.tsx - 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 DatasetPanelWrapper has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          const DatasetPanelWrapper = ({
            tableName,
            dbId,
            catalog,
            schema,

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

          const findTabsWithChartsInScopeHelper = (
            dashboardLayout: DashboardLayout,
            chartsInScope: number[],
            componentId: string,
            tabIds: string[],
          Severity: Minor
          Found in superset-frontend/src/dashboard/components/nativeFilters/utils.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 TagModal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          const TagModal: FC<TagModalProps> = ({
            show,
            onHide,
            editTag,
            refreshData,
          Severity: Minor
          Found in superset-frontend/src/features/tags/TagModal.tsx - 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 LeftPanel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function LeftPanel({
            setDataset,
            dataset,
            datasetNames,
          }: LeftPanelProps) {
          Severity: Minor
          Found in superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx - 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 ActivityTable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function ActivityTable({
            activeChild,
            setActiveChild,
            activityData,
            user,
          Severity: Minor
          Found in superset-frontend/src/features/home/ActivityTable.tsx - 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 EncryptedField has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export const EncryptedField = ({
            changeMethods,
            isEditMode,
            db,
            editNewDb,

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

          function ChartTable({
            user,
            addDangerToast,
            addSuccessToast,
            mine,
          Severity: Minor
          Found in superset-frontend/src/features/home/ChartTable.tsx - 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 findParentIdWithCache has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function findParentIdWithCache(
            structure: IStructure,
          ): string | null {
            let parentId = null;
            if (structure) {
          Severity: Minor
          Found in superset-frontend/src/dashboard/util/findParentId.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

          Severity
          Category
          Status
          Source
          Language