airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

    File index.tsx has 282 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
    Severity: Minor
    Found in superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx - About 2 hrs to fix

      Function renderTotalsRow has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        renderTotalsRow(pivotSettings) {
          // Render the final totals rows that has the totals for all the columns.
      
          const {
            rowAttrs,

        Function render has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const {
              height,
              chartAlert,
              chartStatus,
        Severity: Major
        Found in superset-frontend/src/components/Chart/Chart.tsx - About 2 hrs to fix

          Function ModalTrigger has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            (props: ModalTriggerProps, ref: ModalTriggerRef | null) => {
              const [showModal, setShowModal] = useState(false);
              const {
                beforeOpen = () => {},
                onExit = () => {},
          Severity: Major
          Found in superset-frontend/src/components/ModalTrigger/index.tsx - About 2 hrs to fix

            Function render has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const { formatString, testValues } = this.state;
            
                return (
                  <div className="container">

              Function MetricsControl has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              const MetricsControl = ({
                onChange,
                multi,
                value: propsValue,
                columns,

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

              export default function reorderItem({
                entitiesMap,
                source,
                destination,
                position,
              Severity: Minor
              Found in superset-frontend/src/dashboard/util/dnd-reorder.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 save_or_overwrite_slice has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  def save_or_overwrite_slice(
                      # pylint: disable=too-many-arguments,too-many-locals
                      slc: Slice | None,
                      slice_add_perm: bool,
                      slice_overwrite_perm: bool,
              Severity: Minor
              Found in superset/views/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_metric_name has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              def get_metric_name(metric: Metric, verbose_map: dict[str, Any] | None = None) -> str:
                  """
                  Extract label from metric
              
                  :param metric: object to extract label from
              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 transformProps has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function transformProps(
                chartProps: EchartsSunburstChartProps,
              ): SunburstTransformedProps {
                const {
                  formData,

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

              export default function transformProps(
                chartProps: EchartsFunnelChartProps,
              ): FunnelChartTransformedProps {
                const {
                  formData,

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

              const copyTextToClipboard = (getText: () => Promise<string>) =>
                copyTextWithClipboardApi(getText)
                  // If the Clipboard API is not supported, fallback to the older method.
                  .catch(() =>
                    getText().then(
              Severity: Minor
              Found in superset-frontend/src/utils/copy.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

              Function FilterableTable has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              const FilterableTable = ({
                orderedColumnKeys,
                data,
                height,
                filterText = '',
              Severity: Minor
              Found in superset-frontend/src/components/FilterableTable/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 RowLevelSecurityModal has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              function RowLevelSecurityModal(props: RowLevelSecurityModalProps) {
                const { rule, addDangerToast, addSuccessToast, onHide, show } = props;
              
                const [currentRule, setCurrentRule] = useState<RLSObject>({
                  ...DEFAULT_RULE,
              Severity: Minor
              Found in superset-frontend/src/features/rls/RowLevelSecurityModal.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 Label has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function Label(props: LabelProps) {
                const theme = useTheme();
                const { colors, transitionTiming } = theme;
                const { type = 'default', onClick, children, ...rest } = props;
                const {
              Severity: Minor
              Found in superset-frontend/src/components/Label/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 FilterControls has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              const FilterControls: FC<FilterControlsProps> = ({
                dataMaskSelected,
                onFilterSelectionChange,
              }) => {
                const filterBarOrientation = useSelector<RootState, FilterBarOrientation>(

              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

              File TableOverview.stories.tsx has 281 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
              Severity: Minor
              Found in superset-frontend/src/components/Table/TableOverview.stories.tsx - About 2 hrs to fix

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

                export default function transformProps(
                  chartProps: BigNumberTotalChartProps,
                ): BigNumberVizProps {
                  const {
                    width,

                  Function sortRows has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function sortRows(
                    rows: DataRecord[],
                    totalStackedValues: number[],
                    xAxis: string,
                    xAxisSortSeries: SortSeriesType,
                  Severity: Major
                  Found in superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language