airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function getPadding has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

  showLegend: boolean,
  legendOrientation: LegendOrientation,
  addYAxisTitleOffset: boolean,
  zoomable: boolean,
  margin?: string | number | null,

    Function AdhocMetricEditPopoverTitle has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    const AdhocMetricEditPopoverTitle: FC<AdhocMetricEditPopoverTitleProps> = ({
      title,
      isEditDisabled,
      onChange,
    }) => {

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

    const EditorAutoSync: FC = () => {
      const queryEditors = useSelector<SqlLabRootState, QueryEditor[]>(
        state => state.sqlLab.queryEditors,
      );
      const unsavedQueryEditor = useSelector<SqlLabRootState, UnsavedQueryEditor>(
    Severity: Minor
    Found in superset-frontend/src/SqlLab/components/EditorAutoSync/index.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 EstimateQueryCostButton has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    const EstimateQueryCostButton = ({
      getEstimate,
      queryEditorId,
      tooltip = '',
      disabled = false,

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

    const ShareSqlLabQuery = ({
      queryEditorId,
      addDangerToast,
    }: ShareSqlLabQueryProps) => {
      const theme = useTheme();
    Severity: Minor
    Found in superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.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 Tag has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    const Tag = ({
      name,
      id,
      index = undefined,
      onDelete = undefined,
    Severity: Minor
    Found in superset-frontend/src/components/Tags/Tag.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 AsynchronousSelect has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    export const AsynchronousSelect = ({
      fetchOnlyOnSearch,
      withError,
      withInitialValue,
      responseTime,
    Severity: Minor
    Found in superset-frontend/src/components/Select/AsyncSelect.stories.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 DrillDetailMenuItems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    const DrillDetailMenuItems = ({
      chartId,
      formData,
      filters = [],
      isContextMenu = false,

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

    export function Menu({
      data: {
        menu,
        brand,
        navbar_right: navbarRight,
    Severity: Minor
    Found in superset-frontend/src/features/home/Menu.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 ModalHeader has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    const ModalHeader = ({
      isLoading,
      isEditMode,
      useSqlAlchemyForm,
      hasConnectedDb,

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

    function Footer({
      datasetObject,
      addDangerToast,
      hasColumns = false,
      datasets,
    Severity: Minor
    Found in superset-frontend/src/features/datasets/AddDataset/Footer/index.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 ChartHolder has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    const ChartHolder: React.FC<ChartHolderProps> = ({
      id,
      parentId,
      component,
      parentComponent,

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

    export function getContrastingColor(color: string, thresholds = 186) {
      let r = 0;
      let g = 0;
      let b = 0;
      if (color.length > 7) {
    Severity: Minor
    Found in superset-frontend/packages/superset-ui-core/src/color/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 DatabaseList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function DatabaseList({
      addDangerToast,
      addSuccessToast,
      user,
    }: DatabaseListProps) {
    Severity: Minor
    Found in superset-frontend/src/pages/DatabaseList/index.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 drawMap has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function drawMap(mapData) {
        const { features } = mapData;
        const center = d3.geo.centroid(mapData);
        const scale = 100;
        const projection = d3.geo

      Function generateAreaChartTooltipContent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function generateAreaChartTooltipContent(
        d,
        timeFormatter,
        valueFormatter,
        chart,
      Severity: Minor
      Found in superset-frontend/plugins/legacy-preset-chart-nvd3/src/utils.js - About 1 hr to fix

        Function dateFormat has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          dateFormat(
            col,
            formatString,
            utcOutput = false,
            mthNames = mthNamesEn,

          Function fetchAppliedChart has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            fetchAppliedChart(id) {
              const { annotationType } = this.state;
              const registry = getChartMetadataRegistry();
              const queryParams = rison.encode({
                columns: ['slice_name', 'query_context', 'viz_type'],

            Function createImageObj has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function createImageObj() {
                const imageObj = new Image();
                const image = context.createImageData(heatmapDim[0], heatmapDim[1]);
                const pixs = {};
                records.forEach(d => {

              Function shouldComponentUpdate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                shouldComponentUpdate(nextProps, nextState) {
                  const resultsReady =
                    nextProps.queriesResponse &&
                    ['success', 'rendered'].indexOf(nextProps.chartStatus) > -1 &&
                    !nextProps.queriesResponse?.[0]?.error;
              Severity: Minor
              Found in superset-frontend/src/components/Chart/ChartRenderer.jsx - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language